dungeon_crawler
view prototype/src/timer.cc @ 73:67d330038629
ok fixed the dissapearing particle system. Had forgotten to disable TEXTURE_3D after color grading pass
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 21 Oct 2012 02:11:23 +0300 |
parents | 862461b686f4 |
children |
line source
1 #ifndef _MSC_VER
2 #include <chrono>
3 #include "timer.h"
5 using namespace std::chrono;
7 static bool timer_initialized;
8 static time_point<steady_clock> start_time;
10 unsigned long get_time_msec(void)
11 {
12 if(!timer_initialized) {
13 start_time = steady_clock::now();
14 timer_initialized = true;
15 }
17 auto dur = steady_clock::now() - start_time;
18 return duration_cast<milliseconds>(dur).count();
19 }
20 #else
21 #include <Windows.h>
23 unsigned long get_time_msec(void)
24 {
25 return GetTickCount();
26 }
27 #endif