Skip to content

Commit

Permalink
add explanation about top-level compilation to timing macros [skip ci] (
Browse files Browse the repository at this point in the history
#39802)

(cherry picked from commit dca0850)
  • Loading branch information
IanButterworth authored and KristofferC committed Apr 4, 2021
1 parent 7c17464 commit ef32f24
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions base/timing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ allocations, and the total number of bytes its execution caused to be allocated,
returning the value of the expression. Any time spent garbage collecting (gc) or
compiling is shown as a percentage.
In some cases the system will look inside the `@time` expression and compile some of the
called code before execution of the top-level expression begins. When that happens, some
compilation time will not be counted. To include this time you can run `@time @eval ...`.
See also [`@timev`](@ref), [`@timed`](@ref), [`@elapsed`](@ref), and
[`@allocated`](@ref).
Expand Down Expand Up @@ -264,6 +268,10 @@ end
A macro to evaluate an expression, discarding the resulting value, instead returning the
number of seconds it took to execute as a floating-point number.
In some cases the system will look inside the `@elapsed` expression and compile some of the
called code before execution of the top-level expression begins. When that happens, some
compilation time will not be counted. To include this time you can run `@elapsed @eval ...`.
See also [`@time`](@ref), [`@timev`](@ref), [`@timed`](@ref),
and [`@allocated`](@ref).
Expand Down Expand Up @@ -323,6 +331,10 @@ A macro to execute an expression, and return the value of the expression, elapse
total bytes allocated, garbage collection time, and an object with various memory allocation
counters.
In some cases the system will look inside the `@timed` expression and compile some of the
called code before execution of the top-level expression begins. When that happens, some
compilation time will not be counted. To include this time you can run `@timed @eval ...`.
See also [`@time`](@ref), [`@timev`](@ref), [`@elapsed`](@ref), and
[`@allocated`](@ref).
Expand Down

0 comments on commit ef32f24

Please sign in to comment.