我用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._

R相关问答推荐

r带有参考年的两年移动平均线

更改网格的crs以匹配简单要素点对象的crs

高质量地将R格式的图表从Word中输出

在数据表中呈现数学符号

ggplot的轴标签保存在officer中时被剪切

我正在努力用R计算数据集中的中值逐步距离

以相同的方式对每个表进行排序

仅在Facet_WRAP()中的相应方面包含geom_abline()

如何在科学记数法中显示因子

TreeNode打印 twig 并为其上色

将多个列值转换为二进制

在R中,我如何使用滑动窗口计算位置,然后进行过滤?

在数据帧列表上绘制GGPUP

如何在R中使用hmm TMB提前一步预测观察到的状态?

如何删除设置大小的曲线图并添加条形图顶部数字的百分比

R预测包如何处理ARIMA(Auto.arima函数)中的缺失值

是否从列中删除★符号?

如果满足条件,则替换列的前一个值和后续值

如何将字符类对象中的数据转换为R中的字符串

从矩阵创建系数图