Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
TrueClock Class Reference

An interface to whatever real-time clock we might have available in the current environment. More...

`#include "trueClock.h"`

## Public Member Functions
int | get_error_count () const
double | get_long_time ()
double | get_short_raw_time ()
double | get_short_time ()
bool | set_cpu_affinity (uint32_t mask) const

## Static Public Member Functions
static TrueClock * | get_global_ptr ()
| Returns a pointer to the one TrueClock object in the world.

## Public Attributes
| get_error_count
| Returns the number of clock errors that have been detected.
| get_long_time
| get_short_raw_time
| get_short_time

## Detailed Description

An interface to whatever real-time clock we might have available in the current environment.

There is only one TrueClock in existence, and it constructs itself.

The TrueClock returns elapsed real time in seconds since some undefined epoch. Since it is not defined at what time precisely the clock indicates zero, this value can only be meaningfully used to measure elapsed time, by sampling it at two different times and subtracting.

Definition at line 33 of file trueClock.h.

## Member Function Documentation

## ◆ get_global_ptr()

TrueClock * TrueClock::get_global_ptr | ( |  | ) |
| inline static

Returns a pointer to the one TrueClock object in the world.

Definition at line 67 of file trueClock.I.

Referenced by Connection::consider_flush(), OpenALAudioSound::play(), ConnectionReader::poll(), Extractor::step(), OpenALAudioManager::update(), and ConnectionManager::wait_for_readers().

## ◆ set_cpu_affinity()

bool TrueClock::set_cpu_affinity | ( | uint32_t | mask | ) | const

Definition at line 552 of file trueClock.cxx.

## Member Data Documentation

## ◆ get_error_count

int TrueClock::get_error_count
| inline

Returns the number of clock errors that have been detected.

Each time a clock error is detected, in which the value returned by either of the above methods is suspect, the value returned by this method will be incremented. Applications can monitor this value and react, for instance, by resynchronizing their clocks each time this value changes.

Definition at line 53 of file trueClock.h.

## ◆ get_long_time

double TrueClock::get_long_time

Definition at line 39 of file trueClock.h.

## ◆ get_short_raw_time

double TrueClock::get_short_raw_time

Definition at line 50 of file trueClock.h.

## ◆ get_short_time

double TrueClock::get_short_time
| inline

Definition at line 45 of file trueClock.h.

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

- panda/src/express/trueClock.h
- panda/src/express/trueClock.cxx
- panda/src/express/trueClock.I