File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -160,17 +160,20 @@ func (b *B) StartTimer() {
160
160
// runtime.ReadMemStats(&memStats)
161
161
// b.startAllocs = memStats.Mallocs
162
162
// b.startBytes = memStats.TotalAlloc
163
- b .codspeed .startTimestamp = capi .CurrentTimestamp ()
164
163
b .start = highPrecisionTimeNow ()
165
164
b .timerOn = true
166
165
// b.loop.i &^= loopPoisonTimer
166
+
167
+ b .codspeed .startTimestamp = capi .CurrentTimestamp ()
167
168
}
168
169
}
169
170
170
171
// StopTimer stops timing a test. This can be used to pause the timer
171
172
// while performing steps that you don't want to measure.
172
173
func (b * B ) StopTimer () {
173
174
if b .timerOn {
175
+ endTimestamp := capi .CurrentTimestamp ()
176
+
174
177
b .duration += highPrecisionTimeSince (b .start )
175
178
// runtime.ReadMemStats(&memStats)
176
179
// b.netAllocs += memStats.Mallocs - b.startAllocs
@@ -179,7 +182,6 @@ func (b *B) StopTimer() {
179
182
// If we hit B.Loop with the timer stopped, fail.
180
183
// b.loop.i |= loopPoisonTimer
181
184
182
- endTimestamp := capi .CurrentTimestamp ()
183
185
184
186
// Accumulate timestamps for batch submission instead of immediate hook call
185
187
b .codspeed .accumulatedStartTimestamps = append (b .codspeed .accumulatedStartTimestamps , b .codspeed .startTimestamp )
You can’t perform that action at this time.
0 commit comments