Skip to content

Resetting timer from within @timeit fails #172

Description

@sumiya11

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 :^)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions