def METHOD_NAME(self):
    torch.cuda.synchronize()
    for k in self.keys:
        starts = self.start_events[k]
        ends = self.end_events[k]
        if len(starts) == 0:
            raise ValueError("Trying to divide by zero in TimeMeter")
        if len(ends) != len(starts):
            raise ValueError("Call stop before checking value!")
        time = 0
        for start, end in zip(starts, ends):
            time += start.elapsed_time(end)
        self.running_times[k] += time * 1e-3
        self.n[k] += len(starts)
    self.start_events = collections.defaultdict(list)
    self.end_events = collections.defaultdict(list)