22 lines
774 B
TypeScript
22 lines
774 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('加载出错');
|
|
Log.error('[Starter]', e.message || JSON.stringify(e));
|
|
}
|
|
let runTime: number = (performance.now() - started) | 0;
|
|
Log.info(`加载时间${ runTime }ms`);
|
|
if (ZhongIcon.ZhongNode && ZhongIcon.ZhongNode.initTimer)
|
|
ZhongIcon.ZhongNode.initTimer.innerHTML = `加载时间 ${ runTime }ms`;
|
|
}
|
|
} |