Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in if (log) { : argument is not interpretable as logical #6

Open
jkylearmstrongibx opened this issue Aug 16, 2018 · 4 comments
Open

Comments

@jkylearmstrongibx
Copy link

tictoc::tic("CONNECTION_1")
tictoc::toc("CONNECTION_1")
CONNECTION_1: 3.039 sec elapsed
Error in if (log) { : argument is not interpretable as logical

@zmbc
Copy link

zmbc commented Apr 2, 2021

@jkylearmstrongibx There's almost no chance you're still wondering, but you don't supply a name to the toc function. It's just:

tictoc::tic("CONNECTION_1")
tictoc::toc()

@jkylearmstrong
Copy link

I have just resorted to using Sys.time() and setting manually.

My next question would be how does this work if you have multiple timers? How does toc know which timer to give you the time for?

@zmbc
Copy link

zmbc commented Apr 3, 2021

It's a stack. You can't have overlapping timers, but you can have nested timers.

tictoc::tic("CONNECTION_1")
tictoc::tic("CONNECTION_1 -- part 1")
tictoc::toc() # This ends part 1
tictoc::tic("CONNECTION_1 -- part 2")
tictoc::toc() # This ends part 2
tictoc::toc() # This ends the overall timer

Note that I am not the developer of tictoc, just someone who finds it useful :)

@jkylearmstrong
Copy link

I sorta figured that was the case. Thanks for your insights!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants