Timer Class Reference

#include <Timer.hpp>

Collaboration diagram for Timer:

Collaboration graph
[legend]

List of all members.

Static Public Member Functions

static void Reset ()
static void Print (std::string message)
static void PrintAndReset (std::string message)

Static Private Attributes

static time_t StartTime


Detailed Description

A very simple lightweight benchmarking tool. Call Timer::Reset() to reset the timer and Timer::Print() to print the time elapsed to stdout.

Usage:

Timer::Reset(); //do something Timer::PrintAndReset("First thing"); //do something else Timer::Print("Other thing");

which outputs (for example):

First thing time: 10s Other thing time: 2s

Definition at line 55 of file Timer.hpp.


Member Function Documentation

static void Timer::Reset (  )  [inline, static]

Reset the timer

Definition at line 65 of file Timer.hpp.

References StartTime.

Referenced by PrintAndReset().

static void Timer::Print ( std::string  message  )  [inline, static]

Print the elapsed time (to std::cout and the Log file (under logging-level 2) preceded by the message provided.

Parameters:
message 

Definition at line 76 of file Timer.hpp.

References StartTime.

Referenced by PrintAndReset().

static void Timer::PrintAndReset ( std::string  message  )  [inline, static]

Print the elapsed time (to std::cout and the Log file (under logging-level 2) preceded by the message provided, and also reset the timer.

Parameters:
message 

Definition at line 89 of file Timer.hpp.

References Print(), and Reset().


Member Data Documentation

time_t Timer::StartTime [static, private]

The start time.

Definition at line 59 of file Timer.hpp.

Referenced by Print(), and Reset().


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

Generated on Wed Mar 18 12:52:55 2009 for Chaste by  doxygen 1.5.5