feat: exclude async event monitor
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
parent
e323467ed8
commit
7e4c44eadd
@ -98,9 +98,11 @@ export namespace event {
|
|||||||
if (eventCls.isAssignableFrom(event.getClass())) {
|
if (eventCls.isAssignableFrom(event.getClass())) {
|
||||||
let time = Date.now()
|
let time = Date.now()
|
||||||
exec(event);
|
exec(event);
|
||||||
let cost = Date.now() - time;
|
if (event.isAsynchronous()) {
|
||||||
if (cost > 20) {
|
let cost = Date.now() - time;
|
||||||
console.console(`§c注意! §6插件 §b${name} §6处理 §d${this.class2Name(eventCls)} §6事件 §c耗时 §4${cost}ms !`)
|
if (cost > 20) {
|
||||||
|
console.console(`§c注意! §6插件 §b${name} §6处理 §d${this.class2Name(eventCls)} §6事件 §c耗时 §4${cost}ms !`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
Loading…
Reference in New Issue
Block a user