有没有办法改变system.time的精度?
system.time(sum(seq(1.0,10^4,1)))
类似于:
round(system.time(sum(seq(1.0,10^4,1))),digits=6)
答案 0 :(得分:1)
您应该使用包microbenchmark
来实现此目的。
从包DESCRIPTION
:
Package: microbenchmark
Title: Sub microsecond accurate timing functions.
Description: Provides infrastructure to accurately measure and compare the execution time of R expressions.