computeDuration function

computeDuration