2018-08-16 16:51:15 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char name[64];
|
|
|
|
uint64_t start_time_in_us;
|
|
|
|
} Profiler;
|
|
|
|
|
2020-03-05 19:57:51 +00:00
|
|
|
#define PROFILING_COMPILED 0
|
2018-08-16 16:51:15 +00:00
|
|
|
|
2020-03-05 19:57:51 +00:00
|
|
|
#if PROFILING_COMPILED
|
2018-08-16 16:51:15 +00:00
|
|
|
Profiler* profiler_push(const char* name);
|
2020-03-05 19:57:51 +00:00
|
|
|
void _profiler_checkpoint(const char* name);
|
|
|
|
void _profiler_pop();
|
2018-08-16 16:51:15 +00:00
|
|
|
|
2020-03-05 19:57:51 +00:00
|
|
|
void _profiler_print_stats();
|
2018-08-19 20:10:42 +00:00
|
|
|
|
2020-03-05 19:57:51 +00:00
|
|
|
void _profiler_enable();
|
|
|
|
void _profiler_disable();
|
|
|
|
|
|
|
|
#else
|
|
|
|
#define profiler_push(name);
|
|
|
|
#define profiler_checkpoint(name);
|
|
|
|
#define profiler_pop();
|
|
|
|
|
|
|
|
#define profiler_print_stats();
|
|
|
|
|
|
|
|
#define profiler_enable();
|
|
|
|
#define profiler_disable();
|
|
|
|
|
|
|
|
#endif
|