我用system.time(expression)
来测量R函数的执行时间.
我得到的通话输出
system.time(myfunction())
是:
user system elapsed
117.36 5.65 127.86
"用户"和"系统"衡量什么?
我用system.time(expression)
来测量R函数的执行时间.
我得到的通话输出
system.time(myfunction())
是:
user system elapsed
117.36 5.65 127.86
"用户"和"系统"衡量什么?
这在?proc.time
中讨论(system.time()
返回"proc.time"
类的对象):
Details:
‘proc.time’ returns five elements for backwards compatibility, but
its ‘print’ method prints a named vector of length 3. The first
two entries are the total user and system CPU times of the current
R process and any child processes on which it has waited, and the
third entry is the ‘real’ elapsed time since the process was
started.
....和
Value:
....
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._