00001 // BLTime.hh - system-independent time from epoch 00002 00003 #ifndef BLTIME_HH 00004 #define BLTIME_HH 00005 00006 /** BLTime - get time since epoch. 00007 * Entire class could be inline, but is not to prevent bad optimization. 00008 **/ 00009 class BLTime { 00010 public: 00011 /// time() returns time in seconds since epoch (1970) 00012 static long time(); 00013 00014 /// timems() returns the time in milliseconds since epoch (1970) 00015 static long timems(); 00016 00017 /// timeus() returns the time in microseconds since epoch (1970) 00018 static long long timeus(); 00019 00020 /// sleepms() will sleep for a specified number of milliseconds. 00021 static void sleepms(int ms); 00022 }; 00023 00024 #endif // BLTIME_HH