Ignore:
Timestamp:
04/21/17 17:39:29 (7 years ago)
Author:
yushan
Message:

save modif. Todo: axis, domain, mesh, scalar, transformation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan/src/timer.cpp

    r652 r1103  
    88{ 
    99  std::map<std::string,CTimer> CTimer::allTimer; 
     10  std::map<std::string,CTimer> *CTimer::allTimer_ptr = 0; 
    1011   
    1112  CTimer::CTimer(const std::string& name_) : name(name_)  
     
    5253  CTimer& CTimer::get(const std::string name) 
    5354  { 
    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; 
    5766    return it->second; 
    5867  } 
Note: See TracChangeset for help on using the changeset viewer.