code: def compute_between_collection_interval_duration(self, prefix):
          durations = []
          for collection in self.collection_list:
              start = collection[0].start_time
              end = collection[-1].end_time
              durations.append((start, end))
          interstices = [durations[i + 1][0] - durations[i][1] for i, d in enumerate(durations[:-1])]
          for i, entry in enumerate(interstices):
              if interstices[i] < 0:
                  interstices[i] = 0
          self.measures[prefix + 'between_collection_interval_duration_mean'] = get_mean(interstices) \
              if len(interstices) > 0 else 'NA'
          if not self.quiet:
              print
              print self.current_similarity_measure + " between-" + self.current_collection_type + " durations"
              table = [(self.current_collection_type + " 1 (start,end)", "Interval",
                        self.current_collection_type + " 2 (start,end)")] + \
                      [(str(d1), str(i1), str(d2)) for d1, i1, d2 in zip(durations[:-1], interstices, durations[1:])]
              print_table(table)
              print
              print "Mean " + self.current_similarity_measure + " between-" + self.current_collection_type + " duration", \
                  self.measures[prefix + 'between_collection_interval_duration_mean']