Zsh有一个巧妙的功能,可以自动打印比$REPORTTIME执行时间长的命令的计时统计信息。将其视为time根据需要自动执行管道。
从 Zsh 手册:
REPORTTIME
If nonzero, commands whose combined user and system execution times
(measured in seconds) are greater than this value have timing statistics
printed for them.
Run Code Online (Sandbox Code Playgroud)
对于 Bash,是否存在类似的功能或一组启用类似行为的脚本?
小智 5
我有一个实现,在这里:https : //github.com/mstormo/reporttime
克隆 Git 存储库,并简单地获取 reporttime.bash 脚本。还允许您将计时组件直接放入 Bash 提示中,而不是在单独的行中报告。
| 归档时间: |
|
| 查看次数: |
828 次 |
| 最近记录: |