oco
oco

Reputation: 71

system.time command - diffrence?

When I run this command:

system.time(fread('x.csv', header = T)) 

I receive this output:

user   system  elapsed 
4.740  0.048   4.785   

In simple terms, what does each of those means, besides "elapsed," which the time that has passed since running the command? What do User and System mean?

Upvotes: 0

Views: 58

Answers (1)

Antonin M.
Antonin M.

Reputation: 1784

From http://www.ats.ucla.edu/stat/r/faq/timing_code.htm

The values presented (user, system, and elapsed) will be defined by your operating system, but generally, the user time relates to the execution of the code, the system time relates to your CPU, and the elapsed time is the difference in times since you started the stopwatch (and will be equal to the sum of user and system times if the chunk of code was run altogether). While the difference of .42 seconds may not seem like much, this gain in efficiency is huge!

Upvotes: 1

Related Questions