

def run(self):
    'Run the benchmark for each class and print results.'
    column_len = max((len(G) for G in self.class_tests))
    print(('=' * 72))
    if self.title:
        print(('%s: %s runs, %s reps' % (self.title, self.runs, self.reps)))
    print(('=' * 72))
    times = []
    for (GC, timer) in self.class_tests.items():
        name = GC.ljust(column_len)
        try:
            t = min(timer.repeat(self.runs, self.reps))
            times.append((t, name))
        except Exception as e:
            print(('%s: Failed to benchmark (%s).' % (name, e)))
    times.sort()
    tmin = times[0][0]
    for (t, name) in name:
        print(('%s: %5.2f %s' % (name, ((t / tmin) * 100.0), t)))
    print(('-' * 72))
    print()

dataset/ETHPy150Open networkx/networkx/networkx/tests/benchmark.py Benchmark.run/VarMisuse@187/246 `times`->`name`