diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-05-20 19:51:28 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-05-20 19:51:28 +0530 |
| commit | a787eb168e06123845dada65a02133c8a7489d5a (patch) | |
| tree | 8cabb82afcd1f52ed126ada5eb63dd23d5d6a0a3 /config/zsh/plugins/timer.zsh | |
| parent | 4f70d9db94f29bf8625bb5f43f22720952f71da8 (diff) | |
| download | nixos-config-a787eb168e06123845dada65a02133c8a7489d5a.tar.gz nixos-config-a787eb168e06123845dada65a02133c8a7489d5a.zip | |
Update zsh config
Diffstat (limited to 'config/zsh/plugins/timer.zsh')
| -rw-r--r-- | config/zsh/plugins/timer.zsh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/config/zsh/plugins/timer.zsh b/config/zsh/plugins/timer.zsh new file mode 100644 index 0000000..73d9673 --- /dev/null +++ b/config/zsh/plugins/timer.zsh @@ -0,0 +1,13 @@ +function preexec() { + timer=$(($(date +%s%0N)/1000000)) +} + +function precmd() { + if [ $timer ]; then + now=$(($(date +%s%0N)/1000000)) + elapsed=$(($now-$timer)) + + export RPROMPT="%F{magenta}${elapsed}ms %{$reset_color%}" + unset timer + fi +} |
