It is working well, when all the messages are defined in the toc() function.
tictoc::tic("T1")
tictoc::tic("T2")
Sys.sleep(1)
tictoc::toc()
#> T2: 1 sec elapsed
Sys.sleep(2)
tictoc::toc()
#> T1: 3.03 sec elapsed
But if one of the messages is not defined, the message order is not kept.
tictoc::tic("T1")
tictoc::tic()
Sys.sleep(1)
tictoc::toc()
#> T1: 1.03 sec elapsed
Sys.sleep(2)
tictoc::toc()
#> 3.08 sec elapsed
tictoc::tic("T1")
tictoc::tic()
tictoc::tic("T3")
tictoc::tic()
Sys.sleep(1)
tictoc::toc()
#> T3: 1.03 sec elapsed
Sys.sleep(2)
tictoc::toc()
#> T1: 3.06 sec elapsed
Sys.sleep(3)
tictoc::toc()
#> 6.11 sec elapsed
Sys.sleep(4)
tictoc::toc()
#> 10.15 sec elapsed
It looks like that the missing message (msg = NULL) is not registered correctly.
It is working well, when all the messages are defined in the
toc()function.But if one of the messages is not defined, the message order is not kept.
It looks like that the missing message (
msg = NULL) is not registered correctly.