Mercurial > hg > svcore
comparison base/Profiler.cpp @ 1222:771a17925576 piper
Merge from branch 3.0-integration
author | Chris Cannam |
---|---|
date | Thu, 20 Oct 2016 11:19:34 +0100 |
parents | c811991a5efa |
children | 48e9f538e6e9 |
comparison
equal
deleted
inserted
replaced
1214:77320e522253 | 1222:771a17925576 |
---|---|
45 Profiles::~Profiles() | 45 Profiles::~Profiles() |
46 { | 46 { |
47 dump(); | 47 dump(); |
48 } | 48 } |
49 | 49 |
50 #ifndef NO_TIMING | |
50 void Profiles::accumulate( | 51 void Profiles::accumulate( |
51 #ifndef NO_TIMING | |
52 const char* id, clock_t time, RealTime rt | 52 const char* id, clock_t time, RealTime rt |
53 #else | |
54 const char*, clock_t, RealTime | |
55 #endif | |
56 ) | 53 ) |
57 { | 54 { |
58 #ifndef NO_TIMING | |
59 ProfilePair &pair(m_profiles[id]); | 55 ProfilePair &pair(m_profiles[id]); |
60 ++pair.first; | 56 ++pair.first; |
61 pair.second.first += time; | 57 pair.second.first += time; |
62 pair.second.second = pair.second.second + rt; | 58 pair.second.second = pair.second.second + rt; |
63 | 59 |
70 worstPair.first = time; | 66 worstPair.first = time; |
71 } | 67 } |
72 if (rt > worstPair.second) { | 68 if (rt > worstPair.second) { |
73 worstPair.second = rt; | 69 worstPair.second = rt; |
74 } | 70 } |
71 } | |
75 #endif | 72 #endif |
76 } | |
77 | 73 |
78 void Profiles::dump() const | 74 void Profiles::dump() const |
79 { | 75 { |
80 #ifndef NO_TIMING | 76 #ifndef NO_TIMING |
81 | 77 |