From a787eb168e06123845dada65a02133c8a7489d5a Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Tue, 20 May 2025 19:51:28 +0530 Subject: Update zsh config --- config/zsh/plugins/timer.zsh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 config/zsh/plugins/timer.zsh (limited to 'config/zsh/plugins/timer.zsh') 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 +} -- cgit v1.3.1