diff --git a/src/runtime/System.ts b/src/runtime/System.ts index 480a866..76b0bf2 100644 --- a/src/runtime/System.ts +++ b/src/runtime/System.ts @@ -53,6 +53,17 @@ export default class System { } /** + * 延时函数 + */ + async sleep(timeOfMs: number = 1000): Promise { + return new Promise((resolve) => { + setTimeout(() => { + resolve() + }, timeOfMs) + }) + } + + /** * 轻量级提示信息 * @param message 消息内容 * @param type 消息类型,默认为 'info'