From a13750209b3836a4a6a16a7ba881625f397f160f Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Thu, 7 Mar 2024 20:19:26 +0100 Subject: Implement timers properly The timers shown with `M-x timers` are now actual timings. --- src/dged/timers.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/dged/timers.h (limited to 'src/dged/timers.h') 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 -- cgit v1.2.3