查看脚本运行时间命令

来源:互联网 发布:b站翻唱软件 编辑:程序博客网 时间:2024/04/19 20:17

time     ./process_name

 

real 0m1.937s
user 0m0.007s
sys 0m0.006s

 

 

------------------------------------------------------

 real: 从程序开始到运行结束的时间, 中间可能被别的程序中断(时间片到,操作系统调用其它程序进行运行), IO延迟等这些不是程序运行          的时间都会被算在real上面
 user:  user-mode code的运行时间
 sys: kernel-mode code的运行时间 , 系统调用花的时间

 

 (user + sys) 是程序真正消耗的时间。

 

参考:

http://zhgw01.blog.163.com/blog/static/1041481220099274048921/