Skip to contents

Tic-toc logging

Usage

log_tictoc(..., level = INFO, namespace = NA_character_)

Arguments

...

passed to log_level

level

see log_levels()

namespace

x

Author

Thanks to Neal Fultz for the idea and original implementation!

Examples

log_tictoc("warming up")
#> INFO [2024-10-21 07:31:22] global timer tic 0 secs -- warming up
Sys.sleep(0.1)
log_tictoc("running")
#> INFO [2024-10-21 07:31:22] global timer toc 0.1 secs -- running
Sys.sleep(0.1)
log_tictoc("running")
#> INFO [2024-10-21 07:31:22] global timer toc 0.1 secs -- running
Sys.sleep(runif(1))
log_tictoc("and running")
#> INFO [2024-10-21 07:31:23] global timer toc 0.93 secs -- and running