Measures time intervals. More...

#include <cxxtools/clock.h>

Public Member Functions

 Clock ()
 Constructs a Clock.
 Clock (const Clock &cl)
const Clockoperator= (const Clock &cl)
 ~Clock ()
 Destructor.
void start ()
 Start the clock.
Timespan stop ()
 Stop the clock.

Static Public Member Functions

static DateTime getSystemTime ()
 Returns the system time.
static DateTime getLocalTime ()
 Returns the current local time.
static Timespan getSystemTicks ()
 Returns the timespan since a fixed point in the past.

Detailed Description

Measures time intervals.

The clock class can be used like a stop-watch by calling Clock::start() and Clock::stop(). The latter method returns the elapsed time.

Constructor & Destructor Documentation

cxxtools::Clock::Clock ( )

Constructs a Clock.

cxxtools::Clock::Clock ( const Clock cl)
cxxtools::Clock::~Clock ( )

Destructor.

Member Function Documentation

static DateTime cxxtools::Clock::getLocalTime ( )
static

Returns the current local time.

static Timespan cxxtools::Clock::getSystemTicks ( )
static

Returns the timespan since a fixed point in the past.

The getSystemTicks function retrieves the system ticks, in milliseconds. The system time is the time elapsed since i.e. the system was started, or the unix epoch or some other fixed point in the past.

static DateTime cxxtools::Clock::getSystemTime ( )
static

Returns the system time.

const Clock& cxxtools::Clock::operator= ( const Clock cl)
void cxxtools::Clock::start ( )

Start the clock.

Timespan cxxtools::Clock::stop ( )

Stop the clock.

Returns the elapsed time since start was called.


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