Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef TIMESTAMP_H_
00009 #define TIMESTAMP_H_
00010
00011 #include <iostream>
00012 #include <string>
00013
00014 using std::ostream;
00015 using std::string;
00016
00017 namespace lssr {
00018
00026 class Timestamp
00027 {
00028 public:
00029
00033 Timestamp();
00034
00038 unsigned long getCurrentTimeInMs() const;
00039
00043 unsigned long getElapsedTimeInMs() const;
00044
00048 double getCurrentTimeinS() const;
00049
00053 double getElapsedTimeInS() const;
00054
00058 void resetTimer();
00059
00064 string getElapsedTime() const;
00065
00066 private:
00067
00069 unsigned long m_startTime;
00070 };
00071
00073 static Timestamp timestamp;
00074
00076 inline ostream& operator<<(ostream& os, const Timestamp &ts)
00077 {
00078 os << ts.getElapsedTime();
00079 return os;
00080 }
00081
00082 }
00083
00084 #endif