![]() |
My Project
|
|
timer() : A platform-independent timer with microsecond accuracy:
Example: single timer
Example: multiple timers
Accurate and reliable measurement of performance involves several factors:
To take care of much of this boilerplate, timeit provides accurate and reliable estimates of both CPU or GPU code.
Here`s a stripped down example of Monte-Carlo estimation of PI making use of timeit. Notice how it expects a void
function pointer.
This produces:
pi_function took 0.007252 seconds (test machine: Core i7 920 @ 2.67GHz with a Tesla C2070)