libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Static Public Member Functions | List of all members
crn::Timer Class Reference

A class to measure time. More...

#include <CRNTimer.h>

Static Public Member Functions

static void Start ()
 Starts the quick stopwatch. More...
 
static double Stop ()
 Stops the quick stopwatch. More...
 
static void Start (const String &timername)
 Starts a stopwatch. More...
 
static double Split (const String &timername, const String &splitname)
 Records time in a stopwatch. More...
 
static String Stats (const String &timername)
 Dumps statistics to a string. More...
 
static void Destroy (const String &timername)
 Frees a stopwatch. More...
 

Detailed Description

A class to measure time.

This class holds stopwatches that can be used in parallel

Author
Yann LEYDIER
Date
August 2009
Version
0.1

Definition at line 39 of file CRNTimer.h.

Member Function Documentation

void Timer::Destroy ( const String timername)
static

Frees a stopwatch.

Frees a stopwatch

Parameters
[in]timernamethe name of the stopwatch

Definition at line 125 of file CRNTimer.cpp.

double Timer::Split ( const String timername,
const String splitname 
)
static

Records time in a stopwatch.

Records time in a stopwatch. Stores a time with a name.

Parameters
[in]timernamethe name of the stopwatch
[in]splitnamethe name of the split
Returns
the time elapsed since the last split (or the start if this is the first split)

Definition at line 71 of file CRNTimer.cpp.

void Timer::Start ( )
static

Starts the quick stopwatch.

Starts the quick stopwatch.

Warning
Calling Start() twice without calling Stop will discard the effects of the first Start().

Definition at line 136 of file CRNTimer.cpp.

void Timer::Start ( const String timername)
static

Starts a stopwatch.

Starts a stopwatch. Stores the beginning time.

Parameters
[in]timernamethe name of the stopwatch

Definition at line 57 of file CRNTimer.cpp.

String Timer::Stats ( const String timername)
static

Dumps statistics to a string.

Dumps statistics to a string. Can be called at any moment in the process.

Parameters
[in]timernamethe name of the stopwatch
Returns
a string containing statistics

Definition at line 90 of file CRNTimer.cpp.

double Timer::Stop ( )
static

Stops the quick stopwatch.

Stops the quick stopwatch. Do not call without a Start() before!

Returns
the elapsed time

Definition at line 146 of file CRNTimer.cpp.


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