def schedule(self, event):
    if self.last_event:
      rec_delta = (event.time.as_float() - self.last_event.time.as_float())
      if rec_delta > 0:
        log.info("Sleeping for %.0f ms before next event" % (rec_delta * 1000))
        self.simulation.io_master.sleep(rec_delta)
    else:
      self.stats.start_replay(event)

    log.debug("Waiting for %s (maximum wait time: %.0f ms)" %
          ( str(event).replace("\n", ""), self.epsilon_seconds * 1000) )

    now = time.time()
    end = now  + self.epsilon_seconds
    proceed = False
    while True:
      now = time.time()
      if event.proceed(self.simulation):
        proceed = True
        break
      elif end > now:
        break
      self.simulation.io_master.select(self.sleep_interval_seconds)
    if proceed:
      event.timed_out = False
      self.stats.event_matches(event)
    else:
      event.timed_out = True
      self.stats.event_timed_out(event)
    event.replay_time = SyncTime.now()
    self._log_event(event)
    self.last_event = event
dataset/ETHPy150Open ucb-sts/sts/sts/control_flow/event_scheduler.py/DumbEventScheduler.schedule/swapped operands of `>`