Shambho
Shambho

Reputation: 3280

How to compute system.time in micro seconds?

Is there a way to change the precision of system.time?

system.time(sum(seq(1.0,10^4,1)))

To something like:

round(system.time(sum(seq(1.0,10^4,1))),digits=6)

Upvotes: 0

Views: 233

Answers (1)

asb
asb

Reputation: 4432

You should use the package microbenchmark for this purpose.

From the package DESCRIPTION:

Package:            microbenchmark
Title:              Sub microsecond accurate timing functions.
Description:        Provides infrastructure to accurately measure and compare the execution time of R expressions.

Upvotes: 1

Related Questions