MCPcopy
hub / github.com/ampproject/amphtml / sleep

Function sleep

testing/helpers/index.js:25–29  ·  view source on GitHub ↗
(ms, setTimeoutFunc = setTimeout)

Source from the content-addressed store, hash-verified

23 * @return {Promise<void>}
24 */
25export function sleep(ms, setTimeoutFunc = setTimeout) {
26 return new Promise((resolve) => {
27 setTimeoutFunc(resolve, ms);
28 });
29}
30
31/**
32 * A convenience method to flush the event queue by calling `await macroTask()`

Calls

no outgoing calls

Tested by

no test coverage detected