Skip to content

mikemackintosh/chrono

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chrono

Installation

wget https://github.com/mikemackintosh/chrono/releases/download/v1.0.6/chrono-linux-amd64
sudo cp chrono-linux-amd64 /usr/local/bin/chrono
sudo chmod +x /usr/local/bin/chrono

Then, with zsh you can use it by adding the following to your .zshrc:

_preexec_chrono() {
  export START_TIME=$(chrono -m)
}
preexec_functions+=(_preexec_chrono)

_precmd_chrono() {
  CHRONO_DURATION=$(chrono)
  unset START_TIME
}
precmd_functions+=(_precmd_chrono)

And then call the $CHRONO_DURATION variable in one of your prompts, such as:

precmd() {
  RPROMPT="%B%F{215}${CHRONO_DURATION}%f%b"
}

About

The most accurate way to track command execution time right in your terminal

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published