BenchmarkTools.jl
BenchmarkTools.jl copied to clipboard
@btime in local scope throws UndefVarError
using BenchmarkTools
x = 4
let y = x
@btime y^2
end
or
using BenchmarkTools
x = 4
let
y = x
@btime y^2
end
Throws UndefVarError saying y is not defined. @time works with no problem.
I should have read the README doc first...
(After reading the doc) README doc says we should use interpolation, but didn't say error thrown if not interpolate. I feel like the examples should not throw errors, instead just give the benchmark result, just like when @btime is applied to a global variable.
Reopen this issue.