Go to the source code of this file.
Data Structures | |
struct | stopwatch |
Functions | |
double | time_difference (const struct timespec *t1, const struct timespec *t0) |
Find the difference between two times. | |
struct stopwatch * | stopwatch_new () |
Create a new stopwatch. | |
void | stopwatch_start (struct stopwatch *t) |
Start a stopwatch. | |
void | stopwatch_stop (struct stopwatch *t) |
Stop a stopwatch. | |
void | stopwatch_delete (struct stopwatch *t) |
Delete a stopwatch. | |
void | stopwatch_reset (struct stopwatch *t) |
Reset a stopwatch. | |
double | stopwatch_elapsed (struct stopwatch *t) |
Get the elapsed time of a stopwatch. |
struct stopwatch |
Definition at line 26 of file stopwatch.c.
Data Fields | ||
---|---|---|
double | elapsed | |
struct timespec | start | |
struct timespec | stop |
void stopwatch_delete | ( | struct stopwatch * | t | ) |
Delete a stopwatch.
t | The stopwatch. |
Definition at line 135 of file stopwatch.c.
Referenced by poll_delete(), and render_end().
double stopwatch_elapsed | ( | struct stopwatch * | t | ) |
Get the elapsed time of a stopwatch.
t | The stopwatch. |
Definition at line 145 of file stopwatch.c.
References stopwatch::elapsed, stopwatch_start(), and stopwatch_stop().
Referenced by main(), poll_ui(), render_calculate(), and render_display().
|
read |
Create a new stopwatch.
Definition at line 32 of file stopwatch.c.
Referenced by main(), poll_new(), and render_begin().
void stopwatch_reset | ( | struct stopwatch * | t | ) |
Reset a stopwatch.
t | The stopwatch. |
Definition at line 139 of file stopwatch.c.
References stopwatch::elapsed, stopwatch_start(), and stopwatch_stop().
Referenced by main(), poll_set_timeout(), poll_ui(), and render_calculate().
void stopwatch_start | ( | struct stopwatch * | t | ) |
Start a stopwatch.
t | The stopwatch. |
Definition at line 36 of file stopwatch.c.
References stopwatch::start.
Referenced by poll_new(), stopwatch_elapsed(), and stopwatch_reset().
void stopwatch_stop | ( | struct stopwatch * | t | ) |
Stop a stopwatch.
t | The stopwatch. |
Definition at line 40 of file stopwatch.c.
References stopwatch::elapsed, stopwatch::start, stopwatch::stop, and time_difference().
Referenced by stopwatch_elapsed(), and stopwatch_reset().
double time_difference | ( | const struct timespec * | t1, |
const struct timespec * | t0 | ||
) |
Find the difference between two times.
t1 | The later time. |
t0 | The earlier time. |
t1 - t0
. Definition at line 22 of file stopwatch.c.
Referenced by stopwatch_stop().