The caller can pre-allocate memory, to improve performance. nEvents is an approximate value for how many seperate events the caller will think they will need, and nSamples is a hint on how many samples we think we will take per event
| 115 | // they will need, and nSamples is a hint on how many samples we think we will take |
| 116 | // per event |
| 117 | void |
| 118 | StatisticalTimer::Reserve( unsigned int nEvents, unsigned int nSamples ) |
| 119 | { |
| 120 | this->nEvents = std::max<unsigned int> (1, nEvents); |
| 121 | this->nSamples = std::max<unsigned int> (1, nSamples); |
| 122 | |
| 123 | Clear( ); |
| 124 | labelID.reserve( nEvents ); |
| 125 | |
| 126 | clkStart.resize( nEvents ); |
| 127 | clkTicks.resize( nEvents ); |
| 128 | |
| 129 | for( unsigned int i = 0; i < nEvents; ++i ) |
| 130 | { |
| 131 | clkTicks.at( i ).reserve( nSamples ); |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | void |
| 136 | StatisticalTimer::setNormalize( bool norm ) |