Changeset 1103 for XIOS/dev/branch_yushan/src/timer.cpp
- Timestamp:
- 04/21/17 17:39:29 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan/src/timer.cpp
r652 r1103 8 8 { 9 9 std::map<std::string,CTimer> CTimer::allTimer; 10 std::map<std::string,CTimer> *CTimer::allTimer_ptr = 0; 10 11 11 12 CTimer::CTimer(const std::string& name_) : name(name_) … … 52 53 CTimer& CTimer::get(const std::string name) 53 54 { 54 std::map<std::string,CTimer>::iterator it = allTimer.find(name); 55 if (it == allTimer.end()) 56 it = allTimer.insert(std::make_pair(name, CTimer(name))).first; 55 // bkp 56 // std::map<std::string,CTimer>::iterator it = allTimer.find(name); 57 // if (it == allTimer.end()) 58 // it = allTimer.insert(std::make_pair(name, CTimer(name))).first; 59 // return it->second; 60 61 if(allTimer_ptr == NULL) allTimer_ptr = new std::map<std::string,CTimer>; 62 63 std::map<std::string,CTimer>::iterator it = (*allTimer_ptr).find(name); 64 if (it == (*allTimer_ptr).end()) 65 it = (*allTimer_ptr).insert(std::make_pair(name, CTimer(name))).first; 57 66 return it->second; 58 67 }
Note: See TracChangeset
for help on using the changeset viewer.