All Downloads are FREE. Search and download functionalities are using the official Maven repository.

g2601_2700.s2621_sleep.solution.ts Maven / Gradle / Ivy

There is a newer version: 1.30
Show newest version
// #Easy #2023_08_31_Time_40_ms_(99.59%)_Space_42.3_MB_(77.98%)

async function sleep(millis: number): Promise {
    await new Promise((resolve) => setTimeout(resolve, millis))
}

/*
 * let t = Date.now()
 * sleep(100).then(() => console.log(Date.now() - t)) // 100
 */

export { sleep }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy