示例#1
0
DWORD GetMilliseconds()
{
#if defined(WIN32)
	return ::timeGetTime();
#endif
#if defined(PLATFORM_MAC)
	Duration duration = AbsoluteToDuration(UpTime());
	return duration < 0 ? duration / -1000 : duration;
#endif // WIN32
}
示例#2
0
DWORD GetMilliseconds()
{
#if defined(PLATFORM_WINDOWS)
	return ::GetTickCount();
#endif
#if defined(PLATFORM_MAC)
	Duration duration = AbsoluteToDuration(UpTime());
	return duration < 0 ? duration / -1000 : duration;
#endif // PLATFORM_WINDOWS
}
示例#3
0
/// Gets the time in milliseconds since some epoch. In this case, system start time.
/// Storing milliseconds in a U32 overflows every 49.71 days
U32 Platform::getRealMilliseconds()
{
   // Duration is a S32 value.
   // if negative, it is in microseconds.
   // if positive, it is in milliseconds.
   Duration durTime = AbsoluteToDuration(UpTime());
   U32 ret;
   if( durTime < 0 )
      ret = durTime / -1000;
   else 
      ret = durTime;

   return ret;
}