This page has been automatically translated using the Google Translate API services. We are working on improving texts. Thank you for your understanding and patience.
Simple objects that allow us, in a comfortable way, to measure the time span between two instants. They are also useful for launching events at regular time intervals (Listing 1).
1 2 3 4 5 6 7 8 9
Create a clock.
Time interval for animation control (in seconds).
The new clock.
Destroy the clock.
void clock_destroy(Clock **clk);
Clock. Will be set to
Detect if a new sequence in an animation has expired.
Time mark of the previous instant. Only relevant if returns
Time mark of the current instant. Only relevant if returns
TRUE if the time has come to launch a new sequence.
FALSE if we have to wait.
Set the clock to 0.0.
void clock_reset(Clock *clk);
Gets the time elapsed since the object was created or since the last call to clock_reset.
The number of seconds (with precision of micro-seconds 0.000001).