R/timer.R

Defines functions timer

timer = function() {
  start_time = Sys.time()
  end_time = 0
  start = function() start_time <<- Sys.time()
  stop = function() end_time <<- Sys.time()
  get = function(stop = FALSE)  {
    if (stop) end_time <<- Sys.time()
    difftime(end_time, start_time, units = "secs")
  }

  list(start = start, stop = stop, get = get)
}

Try the poweRlaw package in your browser

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

poweRlaw documentation built on May 29, 2024, 10:01 a.m.