How to understand the output of time command?

后端 未结 3 836
离开以前
离开以前 2021-02-01 01:58

I am trying to figure out the performance of my code, but I do not understand the output of the time command, Can anybody please explain what does time command outp

3条回答
  •  再見小時候
    2021-02-01 02:26

    From: http://zch051383471952.blogspot.com/2010/01/different-of-real-user-sys-time.html

    Real 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.

提交回复
热议问题