Description Usage Arguments Value Functions Examples
Use a dtt_timer
1 2 3 4 5 6 7 8 9 10 11 | dtt_timer(seconds = 0L, start = FALSE)
dtt_start(x)
dtt_stop(x)
dtt_elapsed(x)
dtt_reset(x, seconds = 0L, start = FALSE)
dtt_is_running(x)
|
seconds |
A count of the start time in seconds. |
start |
A flag indicating whether to start the timer. |
x |
A dtt_timer object. |
A dtt_timer
dtt_start
: Start
dtt_stop
: Stop
dtt_elapsed
: Elapsed Duration
dtt_reset
: Reset
dtt_is_running
: Is Running
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # create a new timer
t <- dtt_timer()
# no time has elapsed because the timer has not started
dtt_elapsed(t)
# start the timer
t <- dtt_start(t)
# get the time elapsed
# time elapsed is increasing because the timer is still running
dtt_elapsed(t)
dtt_elapsed(t)
# stop the timer
t <- dtt_stop(t)
# time elapsed is now fixed
dtt_elapsed(t)
dtt_elapsed(t)
# reset the timer
t <- dtt_reset(t)
dtt_elapsed(t)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.