MCPcopy
hub / github.com/gcui-art/suno-api / sleep

Function sleep

src/lib/utils.ts:11–22  ·  view source on GitHub ↗
(x: number, y?: number)

Source from the content-addressed store, hash-verified

9 * @param y Maximum number of seconds (optional).
10 */
11export const sleep = (x: number, y?: number): Promise<void> => {
12 let timeout = x * 1000;
13 if (y !== undefined && y !== x) {
14 const min = Math.min(x, y);
15 const max = Math.max(x, y);
16 timeout = Math.floor(Math.random() * (max - min + 1) + min) * 1000;
17 }
18 // console.log(`Sleeping for ${timeout / 1000} seconds`);
19 logger.info(`Sleeping for ${timeout / 1000} seconds`);
20
21 return new Promise(resolve => setTimeout(resolve, timeout));
22}
23
24/**
25 * @param target A Locator or a page

Callers 4

keepAliveMethod · 0.90
getCaptchaMethod · 0.90
generateSongsMethod · 0.90
generateLyricsMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected