Added macros for profiling functions and made it possible to compile the

profiling code out
This commit is contained in:
2023-07-09 04:01:56 +01:00
parent c053d20a8f
commit 5e84e270bc
4 changed files with 105 additions and 32 deletions

View File

@@ -3,6 +3,22 @@
#include "aliases.h"
#ifndef MAX_PROFILE_SAMPLES
#define MAX_PROFILE_SAMPLES 1024
#endif // !MAX_PROFILE_SAMPLES
#ifdef ENABLE_PROFILING
#define PROFILE_START profile_start()
#define PROFILE_END profile_end()
#define SAMPLE_START(ID, TITLE) profiler_sample_t ID = sample_start(TITLE)
#define SAMPLE_END(ID) sample_end(&ID)
#else
#define PROFILE_START
#define PROFILE_END
#define SAMPLE_START(ID, TITLE)
#define SAMPLE_END(ID)
#endif // ENABLE_PROFILING
#ifdef __cplusplus
extern "C" {
#endif