Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
stopwatch.hpp
00001 
00002 #ifndef DDF_STOPWATCH_HPP
00003 #define DDF_STOPWATCH_HPP
00004 
00005 #include "ctime.hpp"
00006 
00007 namespace jafar
00008 {
00009   namespace ddf
00010   {
00011 
00017     class StopWatch
00018     {
00019       time  m_start_time;
00020    
00021     public:
00022       StopWatch() { m_start_time = time::current(); }
00023       ~StopWatch() {}
00024    
00025       time Restart() { m_start_time = time::current(); return m_start_time; }
00026       time GetStartTime() { return m_start_time; }
00027       time Elapsed() { return time::current() - m_start_time; }
00028       time ElapsedAndReset() { time res, current = time::current(); res = current - m_start_time; m_start_time = current; return res; }
00029       double ElapsedSec()
00030       {
00031         time elapsed = Elapsed();
00032         return elapsed.to_double();
00033       }
00034 
00035     };
00036 
00037   } // namespace ddf
00038 } // namespace jafar
00039 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:17 for Jafar by doxygen 1.7.6.1
LAAS-CNRS