TBTK::Timer Class Reference

#include <Timer.h>

Static Public Member Functions

static void tick (std::string tag="")
static void tock ()
static unsigned int createAccumulator (const std::string &tag="")
static void tick (unsigned int id)
static void tock (unsigned int id)
static void resetAccumulator (unsigned int id)
static void resetAccumulators ()
static void printAccumulators ()

Detailed Description

A Timer for measuring execution times. A sequence of tick-tock calls will meassure and print the time from tick to tock. Multiple timestamps can be pushed onto the stack by repeated tick calls, and subsequent tock calls will return the time between the most recent tick call and then pop it.

Member Function Documentation

unsigned int TBTK::Timer::createAccumulator ( const std::string &  tag = "")

Create an accumulator that can be used to accumulate multiple time measurements.

void TBTK::Timer::printAccumulators ( )

Print accumulators.

void TBTK::Timer::resetAccumulator ( unsigned int  id)

Reset accumulator.

void TBTK::Timer::resetAccumulators ( )

Reset all accumulators.

void TBTK::Timer::tick ( std::string  tag = "")

Push timestamp onto stack.

tagOptional identifier tag that will be printed together with the elapsed time at subsequent tock call.
void TBTK::Timer::tick ( unsigned int  id)

Initiate a time interval to be added to an accumulator.

void TBTK::Timer::tock ( )

Pop timestamp from stack and print elapsed time and identifier tag.

void TBTK::Timer::tock ( unsigned int  id)

Finalize a time interval add add it to an accumulator.

The documentation for this class was generated from the following file: