mirror of
https://github.com/motajs/template.git
synced 2026-04-12 15:11:10 +08:00
319 B
319 B
@motajs/common 函数
sleep
function sleep(time: number): Promise<void>;
描述
创建一个等待指定时长的异步。
参数
time: 等待时长
使用示例
async function myFunc() {
await sleep(1000);
// 这后面的内容会在 1 秒之后执行
}