summaryrefslogtreecommitdiff
path: root/debugTimer.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-01-16 18:09:15 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-01-16 18:09:15 +0000
commit400410fcd436d5e4310bfa779f0309c5fae5b2c2 (patch)
tree89661918c487e63b6c71f2e9281b553928010606 /debugTimer.h
downloadilt-400410fcd436d5e4310bfa779f0309c5fae5b2c2.tar.bz2
ilt-400410fcd436d5e4310bfa779f0309c5fae5b2c2.tar.xz
ilt-400410fcd436d5e4310bfa779f0309c5fae5b2c2.zip
Initial commit
Stripped back and formatted from https://github.com/BennyQBD/ModernOpenGLTutorial/
Diffstat (limited to 'debugTimer.h')
-rw-r--r--debugTimer.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/debugTimer.h b/debugTimer.h
new file mode 100644
index 0000000..fb95eec
--- /dev/null
+++ b/debugTimer.h
@@ -0,0 +1,27 @@
+#ifndef DEBUGTIMER_H_INCLUDED
+#define DEBUGTIMER_H_INCLUDED
+
+#include <SDL2/SDL.h>
+#include <iostream>
+
+class DebugTimer {
+public:
+ void
+ Start()
+ {
+ startTime = SDL_GetTicks();
+ }
+
+ void
+ End(const std::string & message)
+ {
+ unsigned int endTime = SDL_GetTicks();
+ std::cout << message << (endTime - startTime) << "ms" << std::endl;
+ }
+
+protected:
+private:
+ unsigned int startTime;
+};
+
+#endif // DEBUGTIMER_H_INCLUDED