Beispiel #1
0
// Return the current time as an OsTime value
// The OsTime value is relative to when the system was booted.
void OsDateTimeWnt::getCurTimeSinceBoot(OsTime& rTime)
{
   DWORD msecs;
   long  secs;
   long  usecs;
   static long  start_msecs =   GetTickCount();
   msecs = GetTickCount()-start_msecs;
   secs  =  msecs / MILLISECS_PER_SEC;
   usecs = (msecs % MILLISECS_PER_SEC) * MICROSECS_PER_MILLISEC;

   OsTime timeSinceBoot(secs, usecs);
   rTime = timeSinceBoot;
}
// Return the current time as an OsTime value
// The OsTime value is relative to when the system was booted.
void OsDateTimeLinux::getCurTimeSinceBoot(OsTime& rTime)
{
   double seconds;
   int secs;
   int usecs;

   seconds = secondsSinceBoot();
   secs  = (int)seconds;
   usecs = (int)((seconds - secs) * MICROSECS_PER_SEC);

   OsTime timeSinceBoot(secs, usecs);
   rTime = timeSinceBoot;
}