KristofferC / TimerOutputs.jl

Formatted output of timed sections in Julia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Signature to time function under custom keyword

mfherbst opened this issue · comments

Instead of producing ever growing depths of indention I find the syntax

@timeit timer function tester()
    body
end

extremely convenient. This is fine as long as tester does not have a generic name like LinearAlgebra.mul! or when specialising the same function for many different types. In such cases I would love to have the syntax

@timeit timer "Special Tester" function tester()
    body
end

supported with essentially the meaning

function tester()
    @timeit timer "Special Tester"  begin
        body
    end
end

Would it be possible to support the second syntax in TimerOutput as well?

Note: The second syntax is currently valid code, just it times the definition of the function rather than the call.

Makes sense to me

Awesome! Thanks!