mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-06-05 05:03:16 +02:00
[plugins/runtime] Don't depend on bc
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
This commit is contained in:
parent
e528bd5b33
commit
dbe6daf1f5
1 changed files with 2 additions and 1 deletions
|
|
@ -8,7 +8,8 @@ local _RUNTIME_FILE=$(umask 7077; mktemp /tmp/zsh_runtime.$$.XXXXXX)
|
||||||
function runtime() {
|
function runtime() {
|
||||||
local last=$(cat ${_RUNTIME_FILE} 2>/dev/null)
|
local last=$(cat ${_RUNTIME_FILE} 2>/dev/null)
|
||||||
if [[ -n $last ]]; then
|
if [[ -n $last ]]; then
|
||||||
echo "$(date '+%s')-$last" | bc -ql
|
now=$(date '+%s')
|
||||||
|
echo "$((now-last))"
|
||||||
echo > ${_RUNTIME_FILE}
|
echo > ${_RUNTIME_FILE}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue