import asyncio import base from utils.local import loop, noawait async def test_timer1(): print("timer1") async def test_timer2(): print("timer2") async def main(): timer_id = noawait.add_timer(test_timer1, 1) timer_id = noawait.add_timer(test_timer2, 2) print("Timer id: %d" % timer_id) while True: await asyncio.sleep(1) await noawait.end() if __name__ == '__main__': loop.run_until_complete(main())