From de623b5b34d8512e1b258b556c4022ef72e15bbb Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Thu, 17 Apr 2014 23:04:52 +0200 Subject: [PATCH] Close GH-65: Use $EPOCHSECONDS.. Fixes #64 --- pure.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pure.zsh b/pure.zsh index 5c63503..ac2560e 100644 --- a/pure.zsh +++ b/pure.zsh @@ -43,14 +43,14 @@ prompt_pure_git_dirty() { # displays the exec time of the last command if set threshold was exceeded prompt_pure_cmd_exec_time() { - local stop=$(date +%s) + local stop=$EPOCHSECONDS local start=${cmd_timestamp:-$stop} integer elapsed=$stop-$start (($elapsed > ${PURE_CMD_MAX_EXEC_TIME:=5})) && prompt_pure_human_time $elapsed } prompt_pure_preexec() { - cmd_timestamp=$(date +%s) + cmd_timestamp=$EPOCHSECONDS # shows the current dir and executed command in the title when a process is active print -Pn "\e]0;" @@ -98,6 +98,7 @@ prompt_pure_setup() { prompt_opts=(cr subst percent) + zmodload zsh/datetime autoload -Uz add-zsh-hook autoload -Uz vcs_info