Lunchbox  1.12.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
lunchbox::Clock Class Reference

A class for time measurements. More...

#include <clock.h>

+ Collaboration diagram for lunchbox::Clock:

Public Member Functions

LUNCHBOX_API Clock ()
 Construct a new clock. More...
 
LUNCHBOX_API Clock (const Clock &from)
 Copy-construct a new clock with the same start time . More...
 
LUNCHBOX_API ~Clock ()
 Destroy the clock. More...
 
LUNCHBOX_API Clockoperator= (const Clock &ref)
 Assignment operator. More...
 
LUNCHBOX_API void reset ()
 Reset the base time of the clock to the current time. More...
 
LUNCHBOX_API void set (const int64_t time)
 Set the current time of the clock. More...
 
LUNCHBOX_API float getTimef () const
 
LUNCHBOX_API float resetTimef ()
 
LUNCHBOX_API int64_t getTime64 () const
 
LUNCHBOX_API double getTimed () const
 
LUNCHBOX_API float getMilliSecondsf () const
 Returns the millisecond part of the time elapsed since the last reset. More...
 

Detailed Description

A class for time measurements.

Definition at line 31 of file clock.h.

Constructor & Destructor Documentation

LUNCHBOX_API lunchbox::Clock::Clock ( )

Construct a new clock.

Version
1.0
LUNCHBOX_API lunchbox::Clock::Clock ( const Clock from)

Copy-construct a new clock with the same start time .

Version
1.0
LUNCHBOX_API lunchbox::Clock::~Clock ( )

Destroy the clock.

Version
1.0

Member Function Documentation

LUNCHBOX_API float lunchbox::Clock::getMilliSecondsf ( ) const

Returns the millisecond part of the time elapsed since the last reset.

Obviously the returned time overflows once per second.

Returns
the millisecond part of the time elapsed.
Deprecated:
LUNCHBOX_API int64_t lunchbox::Clock::getTime64 ( ) const
Returns
the elapsed time in milliseconds since the last clock reset.
Version
1.0

Referenced by lunchbox::Referenced::ref().

+ Here is the caller graph for this function:

LUNCHBOX_API double lunchbox::Clock::getTimed ( ) const
Returns
the elapsed time in milliseconds since the last clock reset.
Version
1.0
LUNCHBOX_API float lunchbox::Clock::getTimef ( ) const
Returns
the elapsed time in milliseconds since the last clock reset.
Version
1.0
LUNCHBOX_API Clock& lunchbox::Clock::operator= ( const Clock ref)

Assignment operator.

Version
1.7.2
LUNCHBOX_API void lunchbox::Clock::reset ( )

Reset the base time of the clock to the current time.

Version
1.0
LUNCHBOX_API float lunchbox::Clock::resetTimef ( )
Returns
the elapsed time in milliseconds since the last clock reset and atomically reset the clock.
Version
1.0
LUNCHBOX_API void lunchbox::Clock::set ( const int64_t  time)

Set the current time of the clock.

Version
1.0

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