dungeon_crawler
view prototype/src/timer.cc @ 77:d89b403f630b
added gamma correction (without dialing the lighting down yet)
fixed the incorrect PointLight sphere radius
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 26 Oct 2012 03:03:52 +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