aboutsummaryrefslogtreecommitdiff
path: root/src/porting.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/porting.h')
-rw-r--r--src/porting.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/porting.h b/src/porting.h
index 441a57d77..3133fcc80 100644
--- a/src/porting.h
+++ b/src/porting.h
@@ -86,13 +86,20 @@ void initializePaths();
return GetTickCount();
}
#else // Posix
- #include <sys/timeb.h>
+ #include <sys/time.h>
+ inline u32 getTimeMs()
+ {
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ return tv.tv_sec * 1000 + tv.tv_usec / 1000;
+ }
+ /*#include <sys/timeb.h>
inline u32 getTimeMs()
{
struct timeb tb;
ftime(&tb);
return tb.time * 1000 + tb.millitm;
- }
+ }*/
#endif
} // namespace porting