A Zsh plugin that displays execution time for long-running commands and exports timing data for scripts.
zsh-command-time is a Zsh plugin that displays the execution time of long-running commands in the terminal. It helps users identify slow commands by showing a timing message after commands that exceed a configurable threshold, and it exports the timing data for use in scripts or custom prompts.
Zsh users who want to monitor command performance, optimize their workflow, or integrate timing data into their shell environment.
It offers more flexibility than Zsh's built-in REPORTTIME by tracking total elapsed time (including idle time), provides color-coded visual feedback, and allows extensive customization through environment variables and function overrides.
Show execution time for long commands in zsh
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Measures entire command duration including idle periods, unlike REPORTTIME which only tracks CPU time, making it ideal for monitoring slow I/O or sleep commands as highlighted in the README.
Allows configuration of thresholds, colors, exclusions, and even complete output function overrides, with detailed examples in the README for customizing the zsh_command_time function.
Color-codes output based on duration (green for <1 min, yellow <3 min, red ≥3 min) to quickly highlight slow operations without manual interpretation, as described in the features.
Exports the ZSH_COMMAND_TIME variable, enabling timing data to be used in custom scripts or integrated into shell prompts, adding utility beyond simple display.
Directly conflicts with themes like powerlevel9k that have built-in timing segments, requiring extra configuration or leading to redundant displays, as the README explicitly warns against using it with powerlevel9k.
Runs after every command to check execution time, which could introduce minor latency on systems with many fast commands, though not quantified, it's a common trade-off for such plugins.
Exclusively designed for Zsh, so users of other shells cannot benefit from its features, limiting its applicability in mixed or non-Zsh environments.