KristofferC / TimerOutputs.jl

Formatted output of timed sections in Julia
Other
650 stars 54 forks source link

Shorthand for timing function call #159

Open jw3126 opened 1 year ago

jw3126 commented 1 year ago

I think it would be nice to have

@timeit to myfunc_has_long_name(my, args)

as a shord hand

@timeit to "myfunc_has_long_name" myfunc_has_long_name(my, args)

If people agree, I can make a PR.

ahbarnett commented 1 year ago

Playing around having read the docs, for this I use

to(myfunc_has_long_name)(my, args)

It's clearer to the reader if you call the timeroutput object TIME or something.

KristofferC commented 1 year ago

Seems reasonable to have the syntax as given in the OP as well.

marius311 commented 1 year ago

@jw3126 you might like https://github.com/KristofferC/TimerOutputs.jl/issues/106 or perhaps even turn that into a bonafide package, which I haven't had the motivation to do but anyone is welcome to. Not to take away from that your narrower proposal could just fit in here.