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

| timing.hxx File Reference |

`#include <iostream>`
`#include <sstream>`
`#include <vector>`
`#include <sys/time.h>`

Go to the source code of this file.

## Macros

#define | TIC
#define | TICPUSH
#define | TICTOCLOOP_BEGIN(inner_repetitions, outer_repetitions)
#define | TICTOCLOOP_END
#define | TOC
#define | TOCN
#define | TOCS
#define | USE_NESTED_TICTOC
#define | USETICTOC

## Detailed Description

Timing macros for runtime measurements

This header defines timing macros for runtime measurements. See Timing macros for runtime measurements for examples.

## Macro Definition Documentation

## ◆ USETICTOC

#define USETICTOC

Enable timing using TIC/TOC* pairs. This macro defines temporary storage for the timing data, so it needs to precede the TIC/TOC macros in their context.

## ◆ TIC

#define TIC

Start timing. Requires USE_TICTOC to be defined in the current context.

## ◆ TOC

#define TOC

Stop timing and output result (the time difference w.r.t. the last TIC or TICPUSH instance) to std::cerr.

## ◆ TOCN

#define TOCN

Stop timing. This macro evaluates to the time difference (w.r.t. the last TIC or TICPUSH) in msec as a double.

## ◆ TOCS

#define TOCS

Stop timing. This macro evaluates to the time difference (w.r.t. the last TIC or TICPUSH) as a std::string (including units).

## ◆ USE_NESTED_TICTOC

#define USE_NESTED_TICTOC

Enable timing using TICPUSH/TOC* pairs. This macro defines temporary storage for the timing data, so it needs to precede the TIC/TOC macros in their context.

## ◆ TICPUSH

#define TICPUSH

Start timing, possibly a nested block of code within some other timed code block. Requires USE_NESTED_TICTOC to be defined once in the current context.

## ◆ TICTOCLOOP_BEGIN

#define TICTOCLOOP_BEGIN | ( |  | inner_repetitions,
|  |  | outer_repetitions
| ) |  |

Executes the code block up to TICTOCLOOP_END outer_repetitions x inner_repetitions times. The measurement is averaged over the inner_repetitions, and the best result of the outer_repetitions is reported to std::cerr.

## ◆ TICTOCLOOP_END

#define TICTOCLOOP_END

Ends the timing loop started with the TICTOCLOOP_BEGIN macro and outputs the result.

© 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.0