code: def sleep(self, seconds):
          
          start = self.time()
          while (self.time() - start < seconds and
                 not self.need_to_stop.is_set()):
              self.need_to_stop.wait(self.sim_time)
docs: Sleep in simulated time.