From dbe6daf1f57ee10509c12ddcb92731f3c9a4d3c7 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Tue, 12 Jun 2018 08:29:25 +1000 Subject: [PATCH] [plugins/runtime] Don't depend on bc Signed-off-by: Olivier Mehani --- plugins/runtime/runtime.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/runtime/runtime.plugin.zsh b/plugins/runtime/runtime.plugin.zsh index bae49150e..b55095142 100644 --- a/plugins/runtime/runtime.plugin.zsh +++ b/plugins/runtime/runtime.plugin.zsh @@ -8,7 +8,8 @@ local _RUNTIME_FILE=$(umask 7077; mktemp /tmp/zsh_runtime.$$.XXXXXX) function runtime() { local last=$(cat ${_RUNTIME_FILE} 2>/dev/null) if [[ -n $last ]]; then - echo "$(date '+%s')-$last" | bc -ql + now=$(date '+%s') + echo "$((now-last))" echo > ${_RUNTIME_FILE} fi }