Espresso::Timer
Inherits Espresso::ErrorHandling / Reference / Object
High-resolution time input.
Constructors
Class methods
Retrieves the value (in seconds) of the GLFW timer.
Unless the timer has been set using #global=,
the timer measures time elapsed since GLFW was initialized.
The resolution of the timer is system dependent, but is usually on the order of a few micro- or nanoseconds. It uses the highest-resolution monotonic time source on each supported platform.
Sets the value (in seconds) of the GLFW timer. It then continues to count up from that value. The value must be a positive finite number less than or equal to 18,446,744,073.0, which is approximately 584.5 years.
The upper limit of the timer is calculated as:
floor((2^64 - 1) / 10^9)
and is due to implementations storing nanoseconds in 64 bits.
The limit may be increased in the future.
Current value of the raw timer,
measured in 1 / frequency seconds.
To get the frequency, call #frequency.
Instance methods
Total elapsed time in microseconds (10^-6). Might be rounded depending on the system's precision.
Total elapsed time in milliseconds (10^-3). Might be rounded depending on the system's precision.
Total elapsed time in nanoseconds (10^-9). Might be rounded depending on the system's precision.
Starts (or restarts) the timer.
If multiple consecutive calls are made to this method,
then it has the effect of restarting the the current time segment at the last call.
Any previous time accumulated before this call is kept.
Call #reset to completely restart the timer to zero.