• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ibrcommon/ibrcommon/TimeMeasurement.h

Go to the documentation of this file.
00001 /*
00002  * TimeMeasurement.h
00003  *
00004  *  Created on: 20.01.2010
00005  *      Author: morgenro
00006  */
00007 
00008 #ifndef TIMEMEASUREMENT_H_
00009 #define TIMEMEASUREMENT_H_
00010 
00011 #include <time.h>
00012 #include <iostream>
00013 #include <sys/types.h>
00014 
00015 namespace ibrcommon
00016 {
00017         class TimeMeasurement
00018         {
00019         public:
00020                 TimeMeasurement();
00021                 virtual ~TimeMeasurement();
00022 
00023                 void start();
00024                 void stop();
00025 
00026                 float getMilliseconds();
00027                 float getSeconds();
00028 
00029                 friend std::ostream &operator<<(std::ostream &stream, TimeMeasurement &measurement);
00030 
00031 
00032         private:
00033                 static int64_t timespecDiff(struct timespec *timeA_p, struct timespec *timeB_p);
00034 
00035                 struct timespec _start;
00036                 struct timespec _end;
00037         };
00038 }
00039 
00040 #endif /* TIMEMEASUREMENT_H_ */

Generated on Thu Nov 11 2010 09:49:47 for IBR-DTNSuite by  doxygen 1.7.1