The @esfx/async-delay
package provides the delay
function.
npm i @esfx/async-delay
import { delay } from "@esfx/async-delay";
async function doSomeAction() {
// wait 10 seconds
await delay(10 * 1000);
}
You can read more about the API here.