Add zmodload zsh/zprof to the beginning of the .zshrc file and zprof at the end.
zmodload zsh/zprof
.zshrc
zprof