|
|
Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages |
00001 /*====================================================================== 00002 00003 This file is part of the elastix software. 00004 00005 Copyright (c) University Medical Center Utrecht. All rights reserved. 00006 See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for 00007 details. 00008 00009 This software is distributed WITHOUT ANY WARRANTY; without even 00010 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00011 PURPOSE. See the above copyright notices for more information. 00012 00013 ======================================================================*/ 00014 #ifndef __elxTimer_H_ 00015 #define __elxTimer_H_ 00016 00017 #include "itkObject.h" 00018 #include "itkObjectFactory.h" 00019 #include <ctime> 00020 #include <sstream> 00021 00044 namespace tmr 00045 { 00046 using namespace itk; 00047 00058 class Timer : public Object 00059 { 00060 public: 00062 typedef Timer Self; 00063 typedef Object Superclass; 00064 typedef SmartPointer<Self> Pointer; 00065 typedef SmartPointer<const Self> ConstPointer; 00066 00068 itkNewMacro( Self ); 00069 00071 itkTypeMacro( Timer, Object ); 00072 00074 typedef std::vector<std::size_t> TimeDHMSType; 00075 00077 void StartTimer( void ); 00078 int StopTimer( void ); 00079 int ElapsedClockAndTime( void ); 00080 00084 const std::string & PrintStartTime( void ); 00085 const std::string & PrintStopTime( void ); 00086 const std::string & PrintElapsedTimeDHMS( void ); 00087 const std::string & PrintElapsedTimeSec( void ); 00088 const std::string & PrintElapsedClock( void ); 00089 const std::string & PrintElapsedClockSec( void ); 00090 00092 itkGetConstMacro( StartTime, time_t ); 00093 itkGetConstMacro( StopTime, time_t ); 00094 itkGetConstMacro( ElapsedTime, time_t ); 00095 // itkGetConstMacro( ElapsedTimeDHMS, TimeDHMSType ); 00096 itkGetConstMacro( ElapsedTimeSec, std::size_t ); 00097 itkGetConstMacro( ElapsedClock, double ); 00098 itkGetConstMacro( ElapsedClockSec, double ); 00099 00100 protected: 00101 00102 Timer(); 00103 virtual ~Timer(){}; 00104 00106 time_t m_StartTime; 00107 clock_t m_StartClock; 00108 time_t m_StopTime; 00109 clock_t m_StopClock; 00110 double m_ElapsedTime; 00111 clock_t m_ElapsedClock; 00112 TimeDHMSType m_ElapsedTimeDHMS; 00113 std::size_t m_ElapsedTimeSec; 00114 double m_ElapsedClockSec; 00115 00117 std::string m_StartTimeString; 00118 std::string m_StopTimeString; 00119 std::string m_ElapsedTimeDHMSString; 00120 std::string m_ElapsedTimeSecString; 00121 std::string m_ElapsedClockString; 00122 std::string m_ElapsedClockSecString; 00123 00124 private: 00125 00126 Timer( const Self& ); // purposely not implemented 00127 void operator=( const Self& ); // purposely not implemented 00128 00129 }; // end class Timer 00130 00131 00132 } // end namespace tmr 00133 00134 00135 #endif // end #ifndef __elxTimer_H_
Generated on 11-05-2011 for elastix by 1.7.4 |