Mercurial > hg > Game > Cerium
view TaskManager/Fifo/gettime.h @ 1553:21ddbc06dcde draft
fix GpuScheduler
author | Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 17 Feb 2013 19:42:36 +0900 |
parents | 411401d1cb71 |
children | 7673e2ad2623 |
line wrap: on
line source
#ifndef GETTIME_H_ #define GETTIME_H_ #include <time.h> #ifdef __APPLE__ #include <sys/time.h> #endif /** * Mac OS X側には、clock_gettimeがないので、gettimeofdayを使う */ inline unsigned long long gettime() { unsigned long long time = 0; #ifdef __CERIUM_FIFO__ // ?? struct timespec ts; #ifndef __APPLE__ clock_gettime(CLOCK_REALTIME, &ts); #else struct timeval tv; gettimeofday(&tv, NULL); ts.tv_sec = tv.tv_sec; ts.tv_nsec = tv.tv_usec * 1000; #endif time = ((ts.tv_sec << 32) | ts.tv_nsec ); #endif // __CERIUM_FIFO__ return time; } #endif