【问题标题】:what do "user","system", and "elapsed" times mean in R [duplicate]R中的“用户”,“系统”和“经过”时间是什么意思[重复]
【发布时间】:2013-09-11 03:56:09
【问题描述】:

我在 R 中采用并行计算,并做一些基准测试工作。我注意到当使用多个内核时,system.time 显示usersystem 的时间增加,但elapsed 时间减少了。这是否表明并行计算有效?谢谢。

【问题讨论】:

  • 查看右侧“相关”下的链接。

标签: r parallel-processing


【解决方案1】:

如果您使用help(system.time),您会得到提示,也可以查看help(proc.time)。我引用了它的帮助页面:

价值:

 An object of class ‘"proc_time"’ which is a numeric vector of
 length 5, containing the user, system, and total elapsed times for
 the currently running R process, and the cumulative sum of user
 and system times of any child processes spawned by it on which it
 has waited.  (The ‘print’ method uses the ‘summary’ method to
 combine the child times with those of the main process.)

 The definition of ‘user’ and ‘system’ times is from your OS.
 Typically it is something like

 _The ‘user time’ is the CPU time charged for the execution of user
 instructions of the calling process.  The ‘system time’ is the CPU
 time charged for execution by the system on behalf of the calling
 process._

 Times of child processes are not available on Windows and will
 always be given as ‘NA’.

 The resolution of the times will be system-specific and on
 Unix-alikes times are rounded down to milliseconds.  On modern
 systems they will be that accurate, but on older systems they
 might be accurate to 1/100 or 1/60 sec.  They are typically
 available to 10ms on Windows.

【讨论】:

  • 什么是一个很好的例子 - 由 R 调用触发 - 有助于“系统”时间,而不是“用户”时间?而且,为了具体起见,是否有一个特定的 R 函数在“系统”时间比在“用户”时间产生更多的成本?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-05-16
  • 2014-08-23
  • 1970-01-01
  • 2011-05-05
  • 1970-01-01
  • 1970-01-01
  • 2013-10-19
相关资源
最近更新 更多