Have you seen the
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);
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.