tests/testthat/test-hires_time.R

describe("hires_time", {
  skip_on_cran()

  it("returns hi resolution times", {
    # it is hard to test this, we will just sleep and verify the second time is
    # after the first.
    start <- hires_time()
    Sys.sleep(.1)
    end <- hires_time()
    expect_type(start, "double")
    expect_true(end > start)
  })
})
r-lib/bench documentation built on May 6, 2023, 10:51 a.m.