help?> @timed
@timed
A macro to execute an expression, and return the value of the expression,
elapsed time, total bytes allocated, garbage collection time, and an object
with various memory allocation counters.
See also @time, @timev, @elapsed, and @allocated.
julia> val, t, bytes, gctime, memallocs = @timed rand(10^6);
julia> t
0.006634834
julia> bytes
8000256
julia> gctime
0.0055765
julia> fieldnames(typeof(memallocs))
9-element Array{Symbol,1}:
:allocd
:malloc
:realloc
:poolalloc
:bigalloc
:freecall
:total_time
:pause
:full_sweep
julia> memallocs.total_time
5576500
Edit I just saw what Elrod wrote, lol. Definitely use BenchmarkTools for more accurate benchmarks, because they deal with warm up time and they average times as well.