我正在使用 system.time(expression)
来测量 R 函数的执行时间。
我获得的调用输出
system.time(myfunction())
是:
user system elapsed
117.36 5.65 127.86
“用户”和“系统”衡量什么?
最佳答案
我读过的关于用户
和系统
运行时间之间差异的最清晰的解释由William Dunlap on [R-help]提供。 :
"User CPU time" gives the CPU time spent by the current process (i.e., the current R session) and "system CPU time" gives the CPU time spent by the kernel (the operating system) on behalf of the current process. The operating system is used for things like opening files, doing input or output, starting other processes, and looking at the system clock: operations that involve resources that many processes must share.
虽然 ?proc.time
返回类似的内容,但这个描述对我来说更容易理解。
关于r - R system.time(exp) 输出中测量的 'user' 和 'system' 时间是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5688949/