From 400410fcd436d5e4310bfa779f0309c5fae5b2c2 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 16 Jan 2021 18:09:15 +0000 Subject: Initial commit Stripped back and formatted from https://github.com/BennyQBD/ModernOpenGLTutorial/ --- debugTimer.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 debugTimer.h (limited to 'debugTimer.h') 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 +#include + +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 -- cgit v1.2.3