<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def next(self):
 """ Runs the next iteration of the benchmark. """

        if self.count == 0:
            raise StopIteration
        elif self.count > 1:
            print_rehearsal_header()
        else:
            if self.rehearse:
                gc.collect()
                print("-" * 59)
                print()
            print_header()

        self.count -= 1
        return self