|
Teamcenter C++ API Reference
2312
|
A simple wrapper over the SYSS CLOCK timer functions. More...
#include <Timer.hxx>
Public Member Functions | |
| const char * | elapsedString () const |
| char * | logElapsedString (const char *text) const |
| void | readTimer (TIMER_CLOCK_timer_values_t &values) const |
| void | reset () |
| void | start () |
| void | stop () |
| Timer (logical startNow=true) | |
| ~Timer () | |
Static Public Member Functions | |
| static bool | isLoginTimerEnabled () |
Private Member Functions | |
| Timer & | operator= (const Timer &other) |
| Timer (const Timer &other) | |
Private Attributes | |
| char | m_buffer [128] |
| unsigned short | m_timer |
Static Private Attributes | |
| static double | s_incrementalCpu |
| static double | s_incrementalReal |
| static bool | s_logEnabled |
| static bool | s_logEnabledChecked |
A simple wrapper over the SYSS CLOCK timer functions.
| Timer::Timer | ( | logical | startNow = true | ) |
Constructor.
| startNow | (I) Specifies when the timer starts |
| Timer::~Timer | ( | ) |
Default destructor.
|
private |
Private default constructor
| const char* Timer::elapsedString | ( | ) | const |
Returns the elapsed time in seconds for both the real and cpu times ( e.g. "0.998000s cpu, 1.001000s real" ).
Returns the elapsed time in seconds for both the Central Processing Unit (CPU) and real times.
The CPU time measures the amount of time for which a central processing unit (CPU) was used, while the real time includes the waiting time for input/output (I/O) operations or entering low-power (idle) mode.
The output string is in the format "[d+].[d+]s cpu,[d+].[d+]s real", e.g. "0.998000s cpu, 1.001000s real".
|
static |
Checks if login timer is enabled, using "TC_LOGIN_TIMER" preference.
| char* Timer::logElapsedString | ( | const char * | text | ) | const |
Constructs a string output for logging.
The output string is in the format ">> Global Timer [text], cpu & real, [d+].[d+],[d+].[d+]", e.g. ">> Global Timer text, cpu & real, 0.999000, 1.001000".
| text | (I) The input text to add for logging |
| void Timer::readTimer | ( | TIMER_CLOCK_timer_values_t & | values | ) | const |
Returns the timer values ( CPU, children CPU and real times ).
| values | (OF) The output in TIMER_CLOCK_timer_values_t structure |
| void Timer::reset | ( | ) |
Resets the timer.
| void Timer::start | ( | ) |
Starts timer.
| void Timer::stop | ( | ) |
Stops timer.
|
mutableprivate |
|
private |