mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-02 17:44:31 +08:00
优化开始界面代码
This commit is contained in:
1 parent
9e51b03a4d
commit
17e282a835
2 files changed
+34
-29
No files matched your search
+11
-2
@@ -197,9 +197,18 @@ export function download(content: string, name: string) {
|
||||
* @param funcs 函数列表
|
||||
* @param interval 调用间隔
|
||||
*/
|
||||
export async function doByInterval(funcs: (() => void)[], interval: number) {
|
||||
export async function doByInterval(
|
||||
funcs: (() => void)[],
|
||||
interval: number,
|
||||
awaitFirst: boolean = false
|
||||
) {
|
||||
for await (const fn of funcs) {
|
||||
await sleep(interval);
|
||||
if (awaitFirst) {
|
||||
await sleep(interval);
|
||||
}
|
||||
fn();
|
||||
if (!awaitFirst) {
|
||||
await sleep(interval);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user