00001
00002
00003 #include "osl/misc/milliSeconds.h"
00004 #ifdef _WIN32
00005 # include <sys/timeb.h>
00006 #else
00007 # include <sys/time.h>
00008 #endif
00009 const osl::misc::MilliSeconds osl::misc::MilliSeconds::now()
00010 {
00011 #ifdef _WIN32
00012 struct _timeb now;
00013 _ftime(&now);
00014 return MilliSeconds((int64_t)now.time*1000 + now.millitm);
00015 #else
00016 timeval now;
00017 gettimeofday(&now, 0);
00018 return MilliSeconds((int64_t)now.tv_sec*1000 + now.tv_usec/1000);
00019 #endif
00020 }
00021
00022
00023
00024
00025
00026