diff options
| author | Albert Cervin <albert@acervin.com> | 2024-03-07 20:19:26 +0100 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2024-03-07 20:19:26 +0100 |
| commit | a13750209b3836a4a6a16a7ba881625f397f160f (patch) | |
| tree | 86c6ee6af1b44b613c6abc913957dda000c069a7 /src/dged/timers.h | |
| parent | f266c624ad197ea6add738df70702dcbf93cb198 (diff) | |
| download | dged-a13750209b3836a4a6a16a7ba881625f397f160f.tar.gz dged-a13750209b3836a4a6a16a7ba881625f397f160f.tar.xz dged-a13750209b3836a4a6a16a7ba881625f397f160f.zip | |
Implement timers properly
The timers shown with `M-x timers` are now actual timings.
Diffstat (limited to 'src/dged/timers.h')
| -rw-r--r-- | src/dged/timers.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/dged/timers.h b/src/dged/timers.h new file mode 100644 index 0000000..4911b54 --- /dev/null +++ b/src/dged/timers.h @@ -0,0 +1,21 @@ +#ifndef _TIMERS_H +#define _TIMERS_H + +struct timer; + +void timers_init(); +void timers_start_frame(); + +struct timer *timer_start(const char *name); +void timer_stop(struct timer *timer); +struct timer *timer_get(const char *name); +float timer_average(const struct timer *timer); +const char *timer_name(const struct timer *timer); + +typedef void (*timer_callback)(const struct timer *timer, void *userdata); +void timers_for_each(timer_callback callback, void *userdata); + +void timers_end_frame(); +void timers_destroy(); + +#endif |
