There is a function:
function fun(x)
a = x + 1
b = x + 2
return a + b
end
Is there a way I can do this?
@custom_macro function fun(x)
a = x + 1
b = x + 2
return a + b
end
So the function fun
is actually:
function fun(x)
@time "line1" a = x + 1
@time "line2" b = x + 2
return a + b
end
Or is there a way I can do this?
function fun(x)
a = x + 1
b = x + 2
return a + b
end
#when I run
@custom_macro fun(10)
#It is actually running:
function fun(x)
@time "line1" a = x + 1
@time "line2" b = x + 2
return a + b
end