Logo Search packages:      
Sourcecode: djvulibre version File versions  Download package

unsigned long GOS::ticks (  )  [static]

Returns a number of elapsed milliseconds. This number counts elapsed milliseconds since a operating system dependent date. This function is useful for timing code.

Definition at line 261 of file GOS.cpp.

Referenced by IW44Image::Transform::Encode::forward(), and sleep().

#if defined(UNIX)
  struct timeval tv;
  if (gettimeofday(&tv, NULL) < 0)
  return (unsigned long)( ((tv.tv_sec & 0xfffff)*1000) 
                          + (tv.tv_usec/1000) );
#elif defined(WIN32)
  DWORD clk = GetTickCount();
  return (unsigned long)clk;
#elif defined(OS2)
  ULONG clk = 0;
  DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, (PVOID)&clk, sizeof(ULONG));
  return clk;
#elif defined(macintosh)
  return (unsigned long)((double)TickCount()*16.66);
# error "Define something here for your operating system"

Generated by  Doxygen 1.6.0   Back to index