Skip to content

Commit b7a51bd

Browse files
authored
Update README.md (#227)
adding time budget example. I find my self needing to dig for it over and over
1 parent 9aff2d0 commit b7a51bd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ BechmarkTools.Trial: 10000 samples with 972 evaluations.
6666
For quick sanity checks, one can use the [`@btime` macro](https://github.com/JuliaCI/BenchmarkTools.jl/blob/master/doc/manual.md#benchmarking-basics), which is a convenience wrapper around `@benchmark` whose output is analogous to Julia's built-in [`@time` macro](https://docs.julialang.org/en/v1/base/base/#Base.@time):
6767

6868
```julia
69-
julia> @btime sin(x) setup=(x=rand())
69+
# The `seconds` expression helps set a rough time budget, see Manual for more explaination
70+
julia> @btime sin(x) setup=(x=rand()) seconds=3
7071
4.361 ns (0 allocations: 0 bytes)
7172
0.49587200950472454
7273
```

0 commit comments

Comments
 (0)