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

Resetting timer from within @timeit fails #172

Open
sumiya11 opened this issue Nov 12, 2023 · 0 comments
Open

Resetting timer from within @timeit fails #172

sumiya11 opened this issue Nov 12, 2023 · 0 comments

Comments

@sumiya11
Copy link

sumiya11 commented Nov 12, 2023

An example:

using TimerOutputs
to = TimerOutput();

@timeit to function foo(ode)
    reset_timer!(to)
end

foo(42)
ERROR: ArgumentError: array must be non-empty
Stacktrace:
 [1] pop!
   @ .\array.jl:1332 [inlined]
 [2] pop!(to::TimerOutput)
   @ TimerOutputs C:\Users\User\.julia\packages\TimerOutputs\RsWnF\src\TimerOutput.jl:103
 [3] foo(ode::Int64)
   @ Main C:\Users\User\.julia\packages\TimerOutputs\RsWnF\src\TimerOutput.jl:242      
 [4] top-level scope
   @ REPL[4]:1

It is easy to get around this, I don't think it is a big issue (probably the error message could be more helpful though), feel free to close this :^)

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

1 participant