void Profiler::stopAndScale(double scale, const std::string &name) { Timestamp t; t.setToCurrentTime(); string s = (name.empty() ? m_last_profile : name); std::map<std::string, Timestamp>::iterator it = m_start_points.find(s); if(it != m_start_points.end()) { double duration = (t - it->second) * scale; m_start_points.erase(it); pair<std::map<std::string, std::vector<double> >::iterator,bool> pdit; pdit.first = m_profiles.find(s); if(pdit.first == m_profiles.end()) { pdit = m_profiles.insert(make_pair(s, vector<double>())); } pdit.first->second.push_back(duration); } }
void DUtils::Random::SeedRand(){ Timestamp time; time.setToCurrentTime(); srand((unsigned)time.getFloatTime()); }