Fix measurement of error duration