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