timer-class: timer

Description Usage Examples

Description

Method to pause execution. Use options('rbettersyntax::silent'=TRUE) to disable all sys.pause commands in e. g. markdown mode.

Usage

1
clock <- timer()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
clock <- timer();

clock$time.absolute(); # return absolute time in seconds.
clock$time(); # return relative time since last reset.
clock$duration(); # return relative time since last stop.
clock$reset(); # resets start time.
clock$stop(); # preserves start time, but starts a new lap.

clock$pause(); # pause until user presses any key.
clock$pause(0.5); # pause for 0.5 seconds
clock$pause(10); # pause for 10 seconds

## End(Not run)

RLogik/rbettersyntax documentation built on Oct. 16, 2019, 5:11 a.m.