summaryrefslogtreecommitdiff
path: root/src/perf.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/perf.h')
-rw-r--r--src/perf.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/perf.h b/src/perf.h
new file mode 100644
index 0000000..25190a8
--- /dev/null
+++ b/src/perf.h
@@ -0,0 +1,23 @@
+#pragma once
+#if defined DEBUG || defined PERF_DEBUG
+#include "typedef.h"
+
+struct PERF_DATA {
+ U64 ticks;
+ U64 lastwrites;
+ U64 lastreads;
+ U64 avgwrites;
+ U64 avgreads;
+
+ U64 writectr;
+ U64 readctr;
+};
+
+extern void perf_loop_begin();
+extern void perf_loop_end();
+
+extern PERF_DATA perf;
+#define perf_run_metric( x ) x()
+#else
+#define perf_run_metric( x )
+#endif