compute durations