Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@btime in local scope throws UndefVarError #287

Open
chunjiw opened this issue Jul 11, 2022 · 3 comments
Open

@btime in local scope throws UndefVarError #287

chunjiw opened this issue Jul 11, 2022 · 3 comments
Labels

Comments

@chunjiw
Copy link

chunjiw commented Jul 11, 2022

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.

@chunjiw
Copy link
Author

chunjiw commented Jul 11, 2022

I should have read the README doc first...

@chunjiw chunjiw closed this as completed Jul 11, 2022
@chunjiw
Copy link
Author

chunjiw commented Jul 12, 2022

(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.

@chunjiw chunjiw reopened this Jul 12, 2022
@gdalle gdalle added the bug label Jun 13, 2023
@gdalle
Copy link
Collaborator

gdalle commented Jun 13, 2023

Similar bug as #280 ?

@gdalle gdalle added this to the v2.0 milestone Sep 18, 2023
@gdalle gdalle removed this from the v2.0 milestone Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants