Stopwatch function in Julia -


in matlab, there pair of functions tic , toc can used start , stop stopwatch timer. example taken link:

tic = rand(12000, 4400); b = rand(12000, 4400); toc c = a'.*b'; toc 

i aware there macro @time in julia has similar functionality.

julia> @time [sin(cos(i)) in 1:100000]; elapsed time: 0.00721026 seconds (800048 bytes allocated) 

is there set of similar functions in julia? @time macro works timing statements can written in 1 or 2 lines. longer portions of code, prefer use tic-toc functions.

what tried

when googled "julia stopwatch", found 1 useful link , 4 unrelated links.

  1. introducing julia/metaprogramming - wikibooks, open ... meta-programming when write julia code process , modify julia code. ... @time macro inserts "start stopwatch" command @ beginning ...
  2. our invisible stopwatch promo - youtube video julia stopwatch
  3. julia larson on twitter: "this #mac osx timer/stopwatch ...
  4. timing episodes of french chef stopwatch
  5. julia griffith | oiselle running apparel women

i don't know why hadn't thought of trying tic() , toc().

from search of julia documentation

tic()

set timer read next call toc() or toq(). macro call @time expr can used time evaluation.


Comments