Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents a high-resolution time interval. More...
#include <omTime.h>
Public Member Functions | |
Time () | |
Create a Time object that represents a time interval of 0 seconds. More... | |
Time (int newNanoseconds) | |
Create a Time object that represents the specified interval of time in nanoseconds. More... | |
Time (Int64 newNanoseconds) | |
Create a Time object that represents the specified interval of time in nanoseconds. More... | |
Time (Float newSeconds) | |
Create a Time object that represents the specified interval of time in seconds. More... | |
Time (Double newSeconds) | |
Create a Time object that represents the specified interval of time in seconds. More... | |
Double | getSeconds () const |
Return the number of seconds that this Time object represents. More... | |
Int64 | getNanoseconds () const |
Return the number of nanoseconds that this Time object represents. More... | |
operator Double () const | |
Convert this Time object into a floating point representation. More... | |
Bool | operator== (const Time &other) const |
Return whether or not this Time object represents the same time as another. More... | |
Bool | operator!= (const Time &other) const |
Return whether or not this Time object represents a different time than another. More... | |
Bool | operator< (const Time &other) const |
Return whether or not this Time object represents an earlier time than another. More... | |
Bool | operator> (const Time &other) const |
Return whether or not this Time object represents a later time than another. More... | |
Bool | operator<= (const Time &other) const |
Return whether or not this Time object represents an earlier or equal time than another. More... | |
Bool | operator>= (const Time &other) const |
Return whether or not this Time object represents a later or equal time than another. More... | |
Time | operator+ (const Time &other) const |
Return the time interval represented by the sum of this time interval and another. More... | |
Time & | operator+= (const Time &other) |
Add the specified time interval to this time interval, modifying it. More... | |
Time | operator- (const Time &other) const |
Return the time interval represented by the difference between this time interval and another. More... | |
Time & | operator-= (const Time &other) |
Subtract the specified time interval from this time interval, modifying it. More... | |
data::String | toString () const |
Return a string representation of this time object. More... | |
operator data::String () const | |
Convert this time object to a string representation. More... | |
Static Public Member Functions | |
static Time | getCurrent () |
Return a time object that represents the current system time. More... | |
A class that represents a high-resolution time interval.
The time is stored internally as a 64-bit signed integer that indicates the number of nanoseconds in the time interval.
|
inline |
Create a Time object that represents a time interval of 0 seconds.
|
inline |
Create a Time object that represents the specified interval of time in nanoseconds.
This overload is provided to allow initialization with 0, which might cause ambiguities.
|
inline |
Create a Time object that represents the specified interval of time in nanoseconds.
|
inline |
Create a Time object that represents the specified interval of time in seconds.
The time is specified by a single floating-point value that gives the number of seconds in the time interval.
|
inline |
Create a Time object that represents the specified interval of time in seconds.
The time is specified by a single floating-point value that gives the number of seconds in the time interval.
|
inline |
Return the number of seconds that this Time object represents.
|
inline |
Return the number of nanoseconds that this Time object represents.
|
inline |
Convert this Time object into a floating point representation.
Doing this may reduce the accuracy of the time interval due to the inaccuracies of floating-point formats.Convert this Time object into a double floating point representation. Doing this may reduce the accuracy of the time interval due to the inaccuracies of floating-point formats.
Return whether or not this Time object represents the same time as another.
Return whether or not this Time object represents a different time than another.
Return whether or not this Time object represents an earlier time than another.
Return whether or not this Time object represents a later time than another.
Return whether or not this Time object represents an earlier or equal time than another.
Return whether or not this Time object represents a later or equal time than another.
Return the time interval represented by the sum of this time interval and another.
Add the specified time interval to this time interval, modifying it.
Return the time interval represented by the difference between this time interval and another.
Subtract the specified time interval from this time interval, modifying it.
|
inline |
Return a string representation of this time object.
|
inline |
Convert this time object to a string representation.
|
inlinestatic |
Return a time object that represents the current system time.
The time is specified as the time since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).