shell 命令 统计执行时间
2016-10-12 00:00
453 查看
start=`date +%s` && sh test.sh |sort|uniq -c && echo $[`date +%s` - $start]
shell 执行 sh test.sh |sort|uniq -c 命令并,统计执行命令花费的时间,单位为秒。。
可以使用 bash 的 time命令 如: time sh test.sh | sort |uniq -c
time 命令返回 real user sys时间
shell 执行 sh test.sh |sort|uniq -c 命令并,统计执行命令花费的时间,单位为秒。。
可以使用 bash 的 time命令 如: time sh test.sh | sort |uniq -c
time 命令返回 real user sys时间
real:是该命令的总耗时,包括user和sys及io等待,时间片切换等待等等 user:是该命令在用户模式下的CPU耗时,也就是内核外的CPU耗时,不含IO等待这些时间 sys:是该命令在内核中的CPU耗时,不含IO,时间片切换耗时. 楼主需要的应该只是real这一项值
相关文章推荐
- 解决:shell脚本中,无法执行time命令,以统计某个程序执行时间
- 解决:shell脚本中,无法执行time命令,以统计某个程序执行时间
- 让history命令可以记录所有shell命令的执行时间
- linux下命令执行时间统计工具time使用小结
- shell 监控一个程序或者命令执行时间
- shell 获取当前时间后根据时间取余数执行命令
- shell学习七-----通过取串长度压测命令执行时间
- 统计命令执行时间和获取swap内存
- shell命令执行的详细时间查看命令time
- 通过date测试shell 命令执行占用的时间
- linux下命令执行时间统计工具time使用小结
- 六种用ruby调用执行shell命令的方法
- [HOLER]VI中执行shell命令
- 如何在sqlplus中查看oracle数据库sql语句执行计划,执行时间和统计信息
- (C#)Windows Shell 编程系列4 - 上下文菜单(iContextMenu)(二)嵌入菜单和执行命令
- 统计程序执行使用时间
- c#关闭系统进程以及如何调用cmd并执行命令开发者在线 Builder.com.cn 更新时间:2008-08-05作者:乔毅 来源:IT168
- Perl 获取shell命令的执行结果
- ASP.NET下使用WScript.Shell执行命令
- ASP.NET下使用WScript.Shell执行命令