Timekeeper: Create a Timekeeper which holds one or more stopwatches on...

View source: R/Timekeeper.R

TimekeeperR Documentation

Create a Timekeeper which holds one or more stopwatches on its fob.

Description

Create a Timekeeper which holds one or more stopwatches on its fob.

Usage

Timekeeper(name = 1, start_watch = TRUE)

Arguments

name

if start_watch is TRUE, then a name must be provided

start_watch

logical, if TRUE start a new Stopwatch

Value

an instance of TimekeeperRefClass

See Also

Other Stopwatch Timekeeper: Stopwatch, Timekeeper_elapsed, Timekeeper_has_watch, Timekeeper_reset, Timekeeper_start, Timekeeper_stop

Examples

## Not run: 
   # create a container class, starting a stopwatch right away
   timer <- Timekeeper(start_watch = TRUE, name = 'master')
   Sys.sleep(3)
   # add another stopwatch
   timer$start("another")
   # let's see what we have so far
   timer
   timer$stop("another")
   timer$elapse("master") 
## End(Not run)

BigelowLab/rscripting documentation built on Oct. 24, 2022, 5:31 p.m.