MCPcopy Create free account
hub / github.com/Xu22Web/tech-study-js / sleep

Function sleep

tech-study.js:2513–2525  ·  view source on GitHub ↗

* @description 等待时间 * @param time * @returns

(time)

Source from the content-addressed store, hash-verified

2511 * @returns
2512 */
2513function sleep(time) {
2514 // 延时
2515 let timeDelay = Number(time);
2516 if (!Number.isInteger(timeDelay)) {
2517 timeDelay = 1000;
2518 }
2519 timeDelay += Math.random() * 500 - 250;
2520 return new Promise((resolve) => {
2521 setTimeout(() => {
2522 resolve(undefined);
2523 }, timeDelay);
2524 });
2525}
2526/**
2527 * @description 暂停学习锁
2528 */

Callers 8

handleSlideVerifyFunction · 0.70
doingExamFunction · 0.70
doExamPracticeFunction · 0.70
initExamFunction · 0.70
findExamPaperFunction · 0.70
readNewsFunction · 0.70
watchVideoFunction · 0.70
refreshTaskListFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected