What do 'real', 'user' and 'sys' mean in the output of time(1)?

前端 未结 7 616
执笔经年
执笔经年 2020-11-22 00:35
$ time foo
real        0m0.003s
user        0m0.000s
sys         0m0.004s
$

What do \'real\', \'user\' and \'sys\' mean in the output of time?

7条回答
  •  情话喂你
    2020-11-22 00:57

    real: The actual time spent in running the process from start to finish, as if it was measured by a human with a stopwatch

    user: The cumulative time spent by all the CPUs during the computation

    sys: The cumulative time spent by all the CPUs during system-related tasks such as memory allocation.

    Notice that sometimes user + sys might be greater than real, as multiple processors may work in parallel.

提交回复
热议问题