![]() |
System clock of the Blaze library.The SystemClock class represents the system clock of the Blaze library. The system clock is the central timing functionality that can be used to query for the start time of the process, the current timestamp and the elapsed time since the start of the process. The following example demonstrates how the single system clock instance is acquired via the theSystemClock() functcion and how the system clock can be used: More...
#include <SystemClock.h>
Inherits blaze::Singleton< SystemClock >.
Public Member Functions | |
Destructor | |
~SystemClock () | |
Destructor for the SystemClock class. | |
Utility functions | |
time_t | start () const |
Returns the timestamp for the start of the process. More... | |
time_t | now () const |
Returns the current timestamp. More... | |
time_t | elapsed () const |
Returns the elapsed time since the start of the process (in seconds). More... | |
Private Types | |
typedef Singleton< SystemClock, NullType, NullType, NullType, NullType, NullType, NullType, NullType, NullType > | SingletonType |
Type of this Singleton instance. | |
Private Member Functions | |
typedef | BLAZE_TYPELIST_8 (NullType, NullType, NullType, NullType, NullType, NullType, NullType, NullType) Dependencies |
Type list of all lifetime dependencies. | |
Constructors | |
SystemClock () | |
Constructor for the SystemClock class. | |
Static Private Member Functions | |
Instance function | |
static boost::shared_ptr< SystemClock > | instance () |
Static Private Attributes | |
Member variables | |
static time_t | start_ |
Timestamp for the start of the process. | |
Member variables | |
static boost::mutex | instanceMutex_ |
Synchronization mutex for access to the singleton. | |
System clock of the Blaze library.
The SystemClock class represents the system clock of the Blaze library. The system clock is the central timing functionality that can be used to query for the start time of the process, the current timestamp and the elapsed time since the start of the process. The following example demonstrates how the single system clock instance is acquired via the theSystemClock() functcion and how the system clock can be used:
|
inline |
Returns the elapsed time since the start of the process (in seconds).
|
inline |
Returns the current timestamp.
|
inline |
Returns the timestamp for the start of the process.