Linux命令之程序(二)
来源:互联网 发布:mac上wine怎么用 编辑:程序博客网 时间:2024/06/11 23:51
Linux命令——time
time命令常用于测量一个命令的运行时间,注意不是用来显示和修改系统时间的(这是date命令干的事情)。它能做的不仅仅是测量运行时间,还可以测量内存、I/O等的使用情况,说法是time a simple command or give resource usage,其中time一词我认为它应该是测量或测定的意思,并不单指时间。一个程序在运行时使用的系统资源通常包括CPU、Memory和I/O等,其中CPU资源的统计包括实际使用时间(real time)、用户态使用时间(the process spent in user mode)、内核态使用时间(the process spent in kernel mode)。但是简单的使用time命令并不能得到内存和I/O的统计数据。
time常用参数
time命令最常用的使用方式就是在其后面直接跟上命令和参数:
time [options]command [arguments...]
在命令执行完成之后就会打印出CPU的使用情况:
real 0m5.064s <== 实际使用时间(real time)
user 0m0.020s <== 用户态使用时间(the process spent in user mode)
sys 0m0.040s <== 内核态使用时间(the process spent in kernel mode)
time命令跟上-p参数可以只打印时间数值(秒数),不打印单位。
time [options]command [arguments...]
在命令执行完成之后就会打印出CPU的使用情况:
real 0m5.064s <== 实际使用时间(real time)
user 0m0.020s <== 用户态使用时间(the process spent in user mode)
sys 0m0.040s <== 内核态使用时间(the process spent in kernel mode)
time命令跟上-p参数可以只打印时间数值(秒数),不打印单位。
0 0
- Linux命令之程序(二)
- linux命令之--touch(二)
- Linux命令 之 sed(二)
- Linux命令 之 find(二)exec
- Linux命令之 grep(二)
- Linux命令之文本处理(二)
- Linux命令之find(二)
- linux常见命令用法之(二)
- Linux命令之文件系统(二)
- PHP之Linux(二) 基本命令
- Linux命令之程序(一)
- linux命令(二十):find命令之exec
- linux命令(二十一):find命令之xargs
- (转载)linux命令之二cd命令
- (转载)linux命令之二十三chmod命令
- (转载)linux命令之二十四tar命令
- (转载)linux命令之二十五chgrp命令
- (转载)linux命令之二十六chown命令
- Linux笔记(45)——计划任务之Crontab
- equal() 与hashcode()之我理解
- 通过java.net.URLConnection发送HTTP请求的方法
- jquery分页插件jquery.pagination.js与springmvc整合
- hibernate中Restrictions用法
- Linux命令之程序(二)
- 关于Android在线直播问题的讨论与研究
- Storm_Storm主要特点
- 我的2015年
- openGL之雾效果---openGL学习笔记(十二)
- 利用反射打开系统的通知栏STATUS_BAR
- 高效、稳定、可复用——手机淘宝主会场框架详解
- 【杭电oj】3788 - ZOJ问题(坑)
- bzoj--2463--谁能赢呢?(博弈)