2010年9月23日 星期四

linux統計執行一段指令所需的時間

Ex:跑個程式,有辦法知道程式從執行到結束所花的時間~
這個時候可以使用time這個指令
--
time ./test.sh

執行完後畫面如下
real 0m0.374s
user 0m0.004s
sys 0m0.032s
--
man time
These statistics consist of(i) the elapsed real time between invocation and termination,
(ii) the user CPU time (the sum of the tms_utime and tms_cutime values in a struct tms as returned by times(2)),(iii) the system CPU time (the sum of the tms_stime and tms_cstime values in a struct tms as returned by times(2)).

參考來源:http://phorum.study-area.org/index.php?action=printpage;topic=55443.0

沒有留言:

張貼留言