Changeset 1157 for XIOS/dev/branch_yushan_merged/src/timer.cpp
- Timestamp:
- 06/06/17 17:09:31 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan_merged/src/timer.cpp
r1156 r1157 6 6 #include <sstream> 7 7 #include "tracer.hpp" 8 #include <iostream> 9 #include <sstream> 8 10 9 11 namespace xios … … 61 63 // return it->second; 62 64 63 if(allTimer_ptr == NULL) allTimer_ptr = new std::map<std::string,CTimer>;65 if(allTimer_ptr == 0) allTimer_ptr = new std::map<std::string,CTimer>; 64 66 65 67 std::map<std::string,CTimer>::iterator it = (*allTimer_ptr).find(name); … … 71 73 string CTimer::getAllCumulatedTime(void) 72 74 { 75 if(allTimer_ptr == 0) allTimer_ptr = new std::map<std::string,CTimer>; 76 73 77 std::ostringstream strOut ; 74 for(std::map<std::string,CTimer>::iterator it= allTimer.begin();it!=allTimer.end();++it)78 for(std::map<std::string,CTimer>::iterator it=(*allTimer_ptr).begin();it!=(*allTimer_ptr).end();++it) 75 79 strOut<<"Timer : "<<it->first<<" --> cumulated time : "<<it->second.getCumulatedTime()<<std::endl ; 76 80 return strOut.str() ; 77 81 } 82 78 83 }
Note: See TracChangeset
for help on using the changeset viewer.