A Julia package for measuring elapsed CPU time in Julia.
You should only use this package if you know what you're doing - CPU time on multi-core processors is a tricky beast. Please at least read the discussion in Issue #1 before proceeding. Once you've done that, to install call:
from the Julia command line.
The exported functions and macros, as well as their absolute time equivalents, are listed in the following table.
|Real time (Julia standard library)||CPU time (CPUTime.jl)|
Note that the finest resolution for CPU time is microseconds, as opposed to nanoseconds for absolute time.
using CPUTime function add_and_sleep() x = 0 for i in 1:1e7 x += i end sleep(1) end @time @CPUtime add_and_sleep()
elapsed CPU time: 0.578552 seconds elapsed time: 1.580263121 seconds (320166488 bytes allocated, 11.91% gc time) ``` html
about 1 month ago