You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most of the times for the msg with non-nothing value we get a messed up printing to the stdout (and if you are lucky and get a nice print at first execution, just try again):
Between the print(_msg, ": ") and the time_print issuing the print statement, there is a significant time gap (enough for other tasks to be able to litter the space with whatever they want - any task that will issue a print can print between the msg: and the rest of @time content.
The solution consists in either moving the msg printing inside the time_print function or returning a string from time_print and issuing a single print statement inside the @time macro body.
The text was updated successfully, but these errors were encountered:
algunion
changed the title
Issue with @time stdout printing when msg is not nothing
Cosmetic bug in @time stdout printing when msg is not nothingJul 23, 2023
When the
@time
macro is called using@time "message" ex
, it can mess up thestdout
print.Consider the following:
Most of the times for the
msg
with non-nothing value we get a messed up printing to the stdout (and if you are lucky and get a nice print at first execution, just try again):The
time 1: time 2: 1.001953 seconds (768 alloc...
mess is caused by the following:Between the
print(_msg, ": ")
and thetime_print
issuing theprint
statement, there is a significant time gap (enough for other tasks to be able to litter the space with whatever they want - any task that will issue aprint
can print between themsg:
and the rest of@time
content.The solution consists in either moving the
msg
printing inside thetime_print
function or returning a string fromtime_print
and issuing a singleprint
statement inside the@time
macro body.The text was updated successfully, but these errors were encountered: