[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]

Timing macros for runtime measurements VIGRA

#include <vigra/timing.hxx>

These macros allow to perform execution speed measurements. Results are reported in milliseconds. However, note that timings below 1 msec are generally subject to round-off errors. Under LINUX, you can #define VIGRA_HIRES_TIMING to get better accuracy, but this requires linking against librt.

Basic usage:

void time_it()
{
... code to be timed
... untimed code
... other code to be timed
}

Instead of TOC, which outputs the time difference to std::cerr, you may use TOCN (the time difference in msec as a double) or TOCS (the time difference as a std::string).

Alternatively, you can perform nested timing like so:

void time_it()
{
... code to be timed
... nested code to be timed
TOC print time for nested code
... more code to be timed
TOC print total time
}

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de)
Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany

html generated using doxygen and Python
vigra 1.11.1 (Fri May 19 2017)