簡介
如果您想查看命令“head -n 10000 largefile.txt”佔用多少CPU時間,則可以使用:
time head -n 10000 largefile.txt real 0m4.866s用戶0m0.001s sys 0m0.021s CPU時間為了訪問GNU版本的time命令,你可能需要指定整個路徑,例如/ usr / bin / time 。 該版本提供更多功能,例如內存和I / O統計信息。 例如:
/ usr / bin / time -f“\ n%E過去了,\ n%U用戶\ n%S系統\ n%M內存\ n%x狀態”head -n 10000 largefile.txt 0:07.96已過, 0.00用戶,0.01系統,1個存儲器0狀態有關更多選項和各種度量的單位,請參閱時間手冊頁 。