Skip to content

Commit dca0850

Browse files
add explanation about top-level compilation to timing macros [skip ci] (#39802)
1 parent da96fef commit dca0850

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

base/timing.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ allocations, and the total number of bytes its execution caused to be allocated,
172172
returning the value of the expression. Any time spent garbage collecting (gc) or
173173
compiling is shown as a percentage.
174174
175+
In some cases the system will look inside the `@time` expression and compile some of the
176+
called code before execution of the top-level expression begins. When that happens, some
177+
compilation time will not be counted. To include this time you can run `@time @eval ...`.
178+
175179
See also [`@timev`](@ref), [`@timed`](@ref), [`@elapsed`](@ref), and
176180
[`@allocated`](@ref).
177181
@@ -264,6 +268,10 @@ end
264268
A macro to evaluate an expression, discarding the resulting value, instead returning the
265269
number of seconds it took to execute as a floating-point number.
266270
271+
In some cases the system will look inside the `@elapsed` expression and compile some of the
272+
called code before execution of the top-level expression begins. When that happens, some
273+
compilation time will not be counted. To include this time you can run `@elapsed @eval ...`.
274+
267275
See also [`@time`](@ref), [`@timev`](@ref), [`@timed`](@ref),
268276
and [`@allocated`](@ref).
269277
@@ -323,6 +331,10 @@ A macro to execute an expression, and return the value of the expression, elapse
323331
total bytes allocated, garbage collection time, and an object with various memory allocation
324332
counters.
325333
334+
In some cases the system will look inside the `@timed` expression and compile some of the
335+
called code before execution of the top-level expression begins. When that happens, some
336+
compilation time will not be counted. To include this time you can run `@timed @eval ...`.
337+
326338
See also [`@time`](@ref), [`@timev`](@ref), [`@elapsed`](@ref), and
327339
[`@allocated`](@ref).
328340

0 commit comments

Comments
 (0)