gpt4 book ai didi

r - "user","system"和 "elapsed"次在 R 中是什么意思

转载 作者:行者123 更新时间:2023-12-03 20:01:16 25 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





What are 'user' and 'system' times measuring in R system.time(exp) output?

(5 个回答)


8年前关闭。




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

最佳答案

如果你这样做 help(system.time)你会得到一个提示,也看看 help(proc.time) .我从它的帮助页面引用:

Value:

 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 - "user","system"和 "elapsed"次在 R 中是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18668110/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com