Lets say i have two function i need to run
await func1()
await func2()
I want to wait for a maximum of 1000ms for func1() to complete. If it does not complete within the 1000ms then call func2(), don't need to cancel the request for func1()
But if the func1() returns in less than 1000ms, let's say 500ms, then it immediately executes the func2()
I thought of trying some custom sleep function but not sure on how I would exit the sleep before hand.