Mercurial > hg > Game > Cerium
annotate TaskManager/Fifo/gettime.h @ 2041:363b7c401c79 draft
Make Rendefing Engine
author | Shin,ichi Uehara |
---|---|
date | Mon, 23 Mar 2015 17:47:12 +0900 |
parents | e9dc25836520 |
children |
rev | line source |
---|---|
1400 | 1 #ifndef GETTIME_H_ |
2 #define GETTIME_H_ | |
3 | |
4 #include <time.h> | |
1401 | 5 #ifdef __APPLE__ |
1698 | 6 #include "rdtsc.h" |
1401 | 7 #endif |
1698 | 8 |
1400 | 9 inline unsigned long long gettime() { |
10 | |
1517
411401d1cb71
remove minor warning.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1401
diff
changeset
|
11 unsigned long long time = 0; |
1400 | 12 #ifndef __APPLE__ |
1698 | 13 struct timespec ts; |
1400 | 14 clock_gettime(CLOCK_REALTIME, &ts); |
1698 | 15 time = ((ts.tv_sec << 32) | ts.tv_nsec ); |
1400 | 16 #else |
1698 | 17 time = rdtsc(); |
1400 | 18 #endif |
19 return time; | |
20 | |
21 } | |
22 | |
23 #endif |