Skip to contents

End a nested timer

Usage

logging_stop_timer(echo = TRUE)

Arguments

echo

(logical(1), default = TRUE) Should the message be written to screen?

Examples

mbg::logging_start_timer(msg = 'Test logging')
#> Test logging
Sys.sleep(0.1)
mbg::logging_stop_timer()
#> Test logging: 0.102 sec elapsed
log_results <- mbg::logging_get_timer_log()
print(log_results)
#>       tic    toc          msg                    callback_msg elapsed
#>     <num>  <num>       <char>                          <char>   <num>
#> 1: 16.754 16.855 Test logging Test logging: 0.101 sec elapsed   0.101
#> 2: 17.008 17.110 Test logging Test logging: 0.102 sec elapsed   0.102
#> 3: 17.520 17.622 Test logging Test logging: 0.102 sec elapsed   0.102