Updated compute_duration to account for locking collections.