public Stopwatch() { this._start = InstrumentationUtils.now(); this._currentSample = 0; float delta = 0f; this._laps = new float[InstrumentationUtils.kMaxSamples]; for (int i = 0; i < this._laps.Length; i++) { this._laps[i] = delta; } }
public void stop() { this._laps[this._currentSample] = InstrumentationUtils.now() - this._start; }
public void start() { this._start = InstrumentationUtils.now(); this._currentSample = (this._currentSample + 1) % InstrumentationUtils.kMaxSamples; }