summaryrefslogtreecommitdiff
path: root/debugTimer.h
blob: fb95eec67177e3e4d2a9edd17ea4d6fdfbf478c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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