linux time shell统计脚本运行时间

time命令最常用的使用方式就是在其后面直接跟上命令和参数:

time <command> [<arguments...>]

在命令执行完成之后就会打印出CPU的使用情况:

real        <== 实际使用时间(real time) 
user       <== 用户态使用时间(the process spent in user mode) 
sys         <== 内核态使用时间(the process spent in kernel mode)

time命令跟上-p参数可以只打印时间数值(秒数),不打印单位。

猜你喜欢

转载自blog.csdn.net/qingfengxd1/article/details/87086835