@@ -550,10 +550,26 @@ this executes an expression, printing the time
550550it took to execute and the memory allocated before
551551returning the value of the expression.
552552
553- Unlike `@time`, it uses the `@benchmark`
554- macro, and accepts all of the same additional
555- parameters as `@benchmark`. The printed time
556- is the *minimum* elapsed time measured during the benchmark.
553+ However, it uses the [`@benchmark`](@ref) to evaluate
554+ `expression` many times, and accepts all of the same
555+ additional parameters as `@benchmark`. It prints both
556+ the minimum and the mean elapsed time, plus information
557+ about allocations (if any) and time spent on
558+ memory garbage collection (GC).
559+
560+ # Examples
561+ ```
562+ julia> @btime log(x[]) setup=(x=Ref(2.0))
563+ min 3.666 ns, mean 3.772 ns (0 allocations)
564+ 0.6931471805599453
565+
566+ julia> @btime sum(log, \$ (fill(2.0, 1000)))
567+ min 3.391 μs, mean 3.441 μs (0 allocations)
568+ 693.1471805599322
569+
570+ julia> @btime rand(1000);
571+ min 724.432 ns, mean 1.462 μs (1 allocation, 7.94 KiB. GC mean 352 ns, 24.11%)
572+ ```
557573"""
558574macro btime (args... )
559575 _, params = prunekwargs (args... )
0 commit comments