| 91 | } |
| 92 | |
| 93 | void |
| 94 | StatisticalTimer::Reset( ) |
| 95 | { |
| 96 | if( nEvents == 0 || nSamples == 0 ) |
| 97 | throw std::runtime_error( "StatisticalTimer::Reserve( ) was not called before Reset( )" ); |
| 98 | |
| 99 | clkStart.clear( ); |
| 100 | clkTicks.clear( ); |
| 101 | |
| 102 | clkStart.resize( nEvents ); |
| 103 | clkTicks.resize( nEvents ); |
| 104 | |
| 105 | for( unsigned int i = 0; i < nEvents; ++i ) |
| 106 | { |
| 107 | clkTicks.at( i ).reserve( nSamples ); |
| 108 | } |
| 109 | |
| 110 | return; |
| 111 | } |
| 112 | |
| 113 | // The caller can pre-allocate memory, to improve performance. |
| 114 | // nEvents is an approximate value for how many seperate events the caller will think |