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

后端 未结 5 1443
粉色の甜心
粉色の甜心 2020-12-04 11:03

I am using system.time(expression) to measure execution time for an R function.

The output I get for the call

system.time(myfunction())
         


        
5条回答
  •  萌比男神i
    2020-12-04 11:25

    Since these are generic anyway, from Wikipedia:

    The term 'user CPU time' can be a bit misleading at first. To be clear, the total time (real CPU time) is the combination of the amount of time the CPU spends performing some action for a program and the amount of time the CPU spends performing system calls for the kernel on the program's behalf. When a program loops through an array, it is accumulating user CPU time. Conversely, when a program executes a system call such as exec or fork, it is accumulating system CPU time.

    http://en.wikipedia.org/wiki/Time_(Unix)#User_Time_vs_System_Time

提交回复
热议问题