vrseasons

view src/timer.c @ 2:eea1b91dc3d4

added is_complete() to framebuffer object and fixed GL_UNSUPPORTED_FRAMEBUFFER on intel
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 13 Apr 2015 16:51:52 +0300
parents
children
line source
1 #include "timer.h"
3 #if defined(__unix__) || defined(__APPLE__)
4 #include <time.h>
6 unsigned long get_msec(void)
7 {
8 struct timespec ts;
9 if(clock_gettime(CLOCK_MONOTONIC, &ts) == -1) {
10 clock_gettime(CLOCK_REALTIME, &ts);
11 }
12 return ts.tv_sec * 1000ul + ts.tv_nsec / 1000000ul;
13 }
15 #elif defined(WIN32)
16 #include <windows.h>
18 unsigned long get_msec(void)
19 {
20 return timeGetTime();
21 }
23 #endif