fix duration calculation

The statistics calculation was using the wrong value for clamping the duration between the start and end.