Changeset 1750 for XIOS/dev/dev_ym/XIOS_ONE_SIDED/src/timer.cpp
- Timestamp:
- 10/18/19 14:30:54 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_ONE_SIDED/src/timer.cpp
r1639 r1750 11 11 std::map<std::string,CTimer> CTimer::allTimer; 12 12 13 CTimer::CTimer(const std::string& name_ ) : name(name_)13 CTimer::CTimer(const std::string& name_, bool trace) : name(name_) 14 14 { 15 isTracing_=trace ; 15 16 reset(); 16 17 } … … 25 26 if (!suspended) 26 27 { 27 traceEnd(name);28 if (isTracing_) traceEnd(name); 28 29 cumulatedTime += getTime() - lastTime; 29 30 } … … 36 37 { 37 38 lastTime = getTime(); 38 traceBegin(name);39 if (isTracing_) traceBegin(name); 39 40 } 40 41 suspended = false; … … 52 53 } 53 54 54 CTimer& CTimer::get(const std::string name )55 CTimer& CTimer::get(const std::string name, bool trace) 55 56 { 56 57 std::map<std::string,CTimer>::iterator it = allTimer.find(name); 57 58 if (it == allTimer.end()) 58 it = allTimer.insert(std::make_pair(name, CTimer(name ))).first;59 it = allTimer.insert(std::make_pair(name, CTimer(name,trace))).first; 59 60 return it->second; 60 61 }
Note: See TracChangeset
for help on using the changeset viewer.