time_taken_message | R Documentation |
Helper function for displaying time taken messages within other functions.
Use proc.time
at start of function and supply this as the
start_time
parameter to this function.
time_taken_message(start_time)
start_time |
The start time. |
A message stating time taken since start time
# a function that sleeps for a specified duration and displays a # 'time taken' message when completed sleep_fn <- function(duration) { start_time <- proc.time() Sys.sleep(duration) time_taken_message(start_time) } sleep_fn(1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.