zsh
has some built in features to time how long commands take.
If you enable the inc_append_history_time option with
setopt inc_append_history_time
Then the time taken to run every command is saved in your history and then can be viewed with history -D
.