Changeset 3f06bb for src/CodePatterns
- Timestamp:
- Mar 2, 2013, 10:45:46 PM (13 years ago)
- Children:
- b9273a
- Parents:
- 8f60da
- git-author:
- Frederik Heber <heber@…> (03/01/13 13:41:05)
- git-committer:
- Frederik Heber <heber@…> (03/02/13 22:45:46)
- File:
-
- 1 edited
-
src/CodePatterns/Chronos.hpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/CodePatterns/Chronos.hpp
r8f60da r3f06bb 16 16 #include <iosfwd> 17 17 #include <map> 18 #include <string> 18 19 19 20 #include "CodePatterns/Singleton.hpp" … … 29 30 friend std::ostream& operator<<(std::ostream &ost, const Chronos &_time); 30 31 public : 32 //!> typedef for the map storing times per token 33 typedef std::map<const std::string, double> TimekeepingMap; 31 34 32 35 /** Returns current kept time of function \a _name. … … 35 38 * @return current amount of time passed for this function, 0 if unknown, -1 if currently running 36 39 */ 37 double getTime(const std::string _name) const;40 double getTime(const std::string &_name) const; 38 41 39 42 /** Resets time counter for this function \a _name to zero. … … 41 44 * @param _name name of function 42 45 */ 43 void resetTime(const std::string _name);46 void resetTime(const std::string &_name); 44 47 45 48 /** Starts Timing for this function \a _name. … … 47 50 * @param _name name of function 48 51 */ 49 void startTiming(const std::string _name);52 void startTiming(const std::string &_name); 50 53 51 54 /** Finishes Timing for this function \a _name. … … 53 56 * @param _name name of function 54 57 */ 55 void endTiming(const std::string _name); 58 void endTiming(const std::string &_name); 59 60 /** Returns const reference to time keeping map. 61 * 62 * \return const ref to timekeeping map 63 */ 64 const TimekeepingMap& getTimekeepingMap() const; 56 65 57 66 /** Sums up total time accounted for. … … 86 95 double getCurrentTime() const; 87 96 97 //!> typedef for the map storing status of time keeping per token 98 typedef std::map<const std::string, double> TimerMap; 88 99 89 typedef std::map<const std::string, double> TimekeepingMap;90 typedef std::map<const std::string, double> TimerStatusMap;100 //!> typedef for the map storing number of recursive calls to this token 101 typedef std::map<const std::string, size_t> TimerRecursionMap; 91 102 103 //!> map storing times per token 92 104 TimekeepingMap AccountedTime; 93 TimerStatusMap TimeRunning; 105 //!> map storing time keeping status per token 106 TimerMap StartingTime; 107 //!> map storing level of recursion per token 108 TimerRecursionMap RecursionMap; 109 110 #ifdef HAVE_TIME_H 111 timespec basetime; 112 #else 113 #ifdef HAVE_SYS_TIME_H 114 struct timezone basetime; 115 #else 116 #ifdef HAVE_SYS_TIMES_H 117 struct tms *basetime; 118 #endif 119 #endif 120 #endif 94 121 }; 95 122 … … 102 129 std::ostream& operator<<(std::ostream &ost, const Chronos &_time); 103 130 131 // inline functions 132 133 inline 134 const Chronos::TimekeepingMap& Chronos::getTimekeepingMap() const 135 { 136 return AccountedTime; 137 } 138 104 139 #endif /* CHRONOS_HPP_ */
Note:
See TracChangeset
for help on using the changeset viewer.
