-
-
Save DrPep/6c2981b20e8b87bb6e3cd5d4427a1dbf to your computer and use it in GitHub Desktop.
Revisions
-
knadh revised this gist
Jul 14, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,12 +7,12 @@ Append this to your ~/.zshrc file. ```shell function preexec() { timer=$(($(date +%s%0N)/1000000)) } function precmd() { if [ $timer ]; then now=$(($(date +%s%0N)/1000000)) elapsed=$(($now-$timer)) export RPROMPT="%F{cyan}${elapsed}ms %{$reset_color%}" -
knadh created this gist
Dec 7, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ ## Elapsed and execution time display for commands in ZSH <img src="http://i.imgur.com/EFGhkzQ.png"> Append this to your ~/.zshrc file. ```shell function preexec() { timer=$(($(date +%s%N)/1000000)) } function precmd() { if [ $timer ]; then now=$(($(date +%s%N)/1000000)) elapsed=$(($now-$timer)) export RPROMPT="%F{cyan}${elapsed}ms %{$reset_color%}" unset timer fi } ``` Remixed from [@adri's snippet](https://coderwall.com/p/kmchbw/zsh-display-commands-runtime-in-prompt]).