summaryrefslogtreecommitdiff
path: root/src/dged/timers.h
blob: ae79a8b6c5bde2c55c87cd300b906a511f5e6235 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef _TIMERS_H
#define _TIMERS_H

#include <stdint.h>

struct timer;

void timers_init();
void timers_start_frame();

struct timer *timer_start(const char *name);
uint64_t timer_stop(struct timer *timer);
struct timer *timer_get(const char *name);
float timer_average(const struct timer *timer);
uint64_t timer_min(const struct timer *timer);
uint64_t timer_max(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