Skip to content

Commit

Permalink
Merge pull request #276 from giordano/mg/btime-return
Browse files Browse the repository at this point in the history
Make `@btime` correctly return the value of the expression in v1.8
  • Loading branch information
vchuravy authored Feb 12, 2022
2 parents bd02a60 + fae983b commit cbf3786
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "BenchmarkTools"
uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
version = "1.3"
version = "1.3.1"

[deps]
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
Expand Down
7 changes: 5 additions & 2 deletions src/execution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,11 @@ function generate_benchmark_definition(eval_module, out_vars, setup_vars, quote_
invocation = :($(Expr(:tuple, out_vars...)) = $(signature))
core_body = :($(core); $(returns))
end
if isdefined(Base, :donotdelete)
invocation = :(Base.donotdelete($invocation))
@static if isdefined(Base, :donotdelete)
invocation = :(let x = $invocation
Base.donotdelete(x)
x
end)
end
return Core.eval(eval_module, quote
@noinline $(signature_def) = begin $(core_body) end
Expand Down

2 comments on commit cbf3786

@vchuravy
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/54501

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.3.1 -m "<description of version>" cbf37861e63ef7b78bcdbd314522cd3072bc4b33
git push origin v1.3.1

Please sign in to comment.