Skip to Content
R Programming By Example
book

R Programming By Example

by Omar Trejo Navarro
December 2017
Beginner to intermediate
470 pages
12h 29m
English
Packt Publishing
Content preview from R Programming By Example

Benchmarking manually with system.time()

Now, we will look into how to benchmark your code. If you're looking for a simple measurement of execution time, system.time() is a good choice. You simply call a function inside of it, and it will print the following three time measures for you: .

  • user: It is the user time that we should pay more attention to, since it measures the CPU time used by R to execute the code
  • system: The system time is a measure of time spent by the system to be able to execute the function
  • elapsed:  The elapsed time is total time it took to execute the code, even if it was slowed down due to other system processes

Sometimes, elapsed time is longer than the sum of user time and system time because the CPU is multitasking ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Efficient R Programming

Efficient R Programming

Colin Gillespie, Robin Lovelace
R Programming

R Programming

Jared P. Lander

Publisher Resources

ISBN: 9781788292542Supplemental Content