def test_new_thread_schedule_action_due(self):
        scheduler = NewThreadScheduler()
        starttime = datetime.utcnow()
        endtime = [None]

        def action(scheduler, state):
            endtime[0] = datetime.utcnow()

        scheduler.schedule_relative(timedelta(milliseconds=200), action)

        sleep(0.3)
        diff = endtime[0]-starttime
        assert(diff > timedelta(milliseconds=180))
dataset/ETHPy150Open ReactiveX/RxPY/tests/test_concurrency/test_newthreadscheduler.py/TestNewThreadScheduler.test_new_thread_schedule_action_due/original