22 lines
767 B
TypeScript
22 lines
767 B
TypeScript
import Log from "../Log";
|
|
import ZhongIcon from "../ZhongIcon";
|
|
|
|
export default class Starter {
|
|
public static run(T): void {
|
|
|
|
if (window.WHTRANS) throw '退出, 已运行次数' + window.WHTRANS;
|
|
window.WHTRANS = window.WHTRANS === undefined ? 1 : window.WHTRANS++;
|
|
|
|
let started = performance.now();
|
|
try {
|
|
T.main();
|
|
} catch (e) {
|
|
Log.error('[Starter]加载出错信息: ' + e.stack || e.message);
|
|
}
|
|
let runTime: number = (performance.now() - started) | 0;
|
|
Log.info(`芜湖脚本完成加载, 耗时${ runTime }ms`);
|
|
if (ZhongIcon.ZhongNode && ZhongIcon.ZhongNode.initTimer)
|
|
ZhongIcon.ZhongNode.initTimer.innerHTML = `加载时间 ${ runTime }ms`;
|
|
}
|
|
}
|