Skip to content

Commit

Permalink
Use $EPOCHSECONDS
Browse files Browse the repository at this point in the history
See associated discussion in sindresorhus#65

Signed-off-by: Arash Rouhani <[email protected]>
  • Loading branch information
smblott-github authored and Tarrasch committed May 28, 2014
1 parent 7f5c4f8 commit 4539816
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pure.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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;"
Expand All @@ -76,6 +76,7 @@ prompt_pure_precmd() {
prompt_pure_setup() {
prompt_opts=(cr subst percent)

zmodload zsh/datetime
autoload -Uz add-zsh-hook
autoload -Uz vcs_info

Expand Down

0 comments on commit 4539816

Please sign in to comment.