How to stop a an asynchronous function immediately at a certain time?

后端 未结 0 617
名媛妹妹
名媛妹妹 2021-01-31 07:20

I want to run a script like this:

while(Date.now() < dateToStop){
    doSomething()
    await new Promise(r => setTim         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题