inst/tinytest/test-format.R

library(benchr)

b <- benchr::benchmark(1 + 1, times = 1L)
us <- benchr:::convert_units(b, units = "us")
ms <- benchr:::convert_units(b, units = "ms")

expect_equal(attr(us, "units"), "us")
expect_equal(attr(ms, "units"), "ms")
expect_equal(us$time / ms$time, 1000)

Try the benchr package in your browser

Any scripts or data that you put into this service are public.

benchr documentation built on March 13, 2020, 3:29 a.m.