The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::TimeManager Class Reference

Singleton which manages wall-clock time for simulations in SPARTA This is not a "timer" manager, but rather an information service and could possible become a timing interval manager. More...

#include <TimeManager.hpp>

Public Member Functions

 TimeManager ()
 Default constructor.
 
double getSecondsElapsed () const
 Gets the number of seconds elapsed since the instantiation of SPARTA static and global vars.
 
double getAbsoluteSeconds () const
 Gets the absolute second timestamp for this machine.
 
std::string getLocalTime () const
 Returns a string representing local time for the simulator.
 
std::string getSortableLocalTime () const
 Returns a string representing local time in a format suitable for trival string sorting.
 
std::string getTimestamp () const
 Returns a unix timestamp string.
 

Static Public Member Functions

static TimeManagergetTimeManager ()
 Returns the TimeManager singleton.
 

Detailed Description

Singleton which manages wall-clock time for simulations in SPARTA This is not a "timer" manager, but rather an information service and could possible become a timing interval manager.

Definition at line 18 of file TimeManager.hpp.

Constructor & Destructor Documentation

◆ TimeManager()

sparta::TimeManager::TimeManager ( )
inline

Default constructor.

Definition at line 27 of file TimeManager.hpp.

Member Function Documentation

◆ getAbsoluteSeconds()

double sparta::TimeManager::getAbsoluteSeconds ( ) const
inline

Gets the absolute second timestamp for this machine.

Definition at line 55 of file TimeManager.hpp.

◆ getLocalTime()

std::string sparta::TimeManager::getLocalTime ( ) const
inline

Returns a string representing local time for the simulator.

Definition at line 64 of file TimeManager.hpp.

◆ getSecondsElapsed()

double sparta::TimeManager::getSecondsElapsed ( ) const
inline

Gets the number of seconds elapsed since the instantiation of SPARTA static and global vars.

Definition at line 46 of file TimeManager.hpp.

◆ getSortableLocalTime()

std::string sparta::TimeManager::getSortableLocalTime ( ) const
inline

Returns a string representing local time in a format suitable for trival string sorting.

Definition at line 77 of file TimeManager.hpp.

◆ getTimeManager()

static TimeManager & sparta::TimeManager::getTimeManager ( )
inlinestatic

Returns the TimeManager singleton.

Note
This method is valid until static destruction

Definition at line 37 of file TimeManager.hpp.

◆ getTimestamp()

std::string sparta::TimeManager::getTimestamp ( ) const
inline

Returns a unix timestamp string.

Definition at line 90 of file TimeManager.hpp.


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