我试图弄清楚我的代码的性能,但我不明白时间命令的输出,任何人都可以解释什么是时间命令输出的意思。
以下是我得到的:
time ./filereader real 0m0.193s user 0m0.012s sys 0m0.056s
什么是真实的,用户的,系统的?
From:
http://zch051383471952.blogspot.com/2010/01/different-of-real-user-sys-time.html
原文链接:https://www.f2er.com/bash/388450.htmlReal refers to actual elapsed time;
User and Sys refer to cpu time used
only by the process.
- Real is wall clock time – time from start to finish of the call. This is
all elapsed time including time slices
used by other processes and time the
process spends blocked (for example if
it is waiting for I/O to complete).- User is the amount of cpu time spent in user-mode code (outside the
kernel) within the process. This is
only actual cpu time used in executing
the process. Other processes and time
the process spends blocked do not
count towards this figure.- Sys is the amount of cpu time spent in the kernel within the process. This means executing cpu time spent in system calls within the kernel,as opposed to library code,which is still running in user-space. Like ‘user’,this is only cpu time used by the process.