timer_basic
Timer accumulating the elapsed time t (update() returns the time step), with start, stop and a speed factor.
Fields and methods
Members of the struct timer_basic. Most of what you do with a CGP type goes through the free functions listed below.
Fields
float t | Accumulated time in seconds, multiplied by scale, 0 until the second update(). |
float scale | Multiplier applied to the elapsed real time (1 by default; larger values accelerate the animation). |
Methods
| Builds a running timer with t = 0 and scale = 1; time is measured from the first update() or start(), so the time spent loading the scene is not counted. src | |
| Advances t by the elapsed real time since the previous update (or start) times scale and returns this time step in seconds; the first call after construction returns 0, and a stopped timer returns 0 without change. src | |
| Resumes the timer, measuring the next time step from now (the time spent stopped is not counted). src | |
| Pauses the timer; update() then returns 0 and t stays constant. src |
Functions taking a timer_basic
None.
Functions returning a timer_basic
None.
Operators
None.