本文整理汇总了Java中co.aikar.timings.Timings.setVerboseEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java Timings.setVerboseEnabled方法的具体用法?Java Timings.setVerboseEnabled怎么用?Java Timings.setVerboseEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类co.aikar.timings.Timings
的用法示例。
在下文中一共展示了Timings.setVerboseEnabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import co.aikar.timings.Timings; //导入方法依赖的package包/类
@Override
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
if (!this.testPermission(sender)) {
return true;
}
if (args.length != 1) {
sender.sendMessage(new TranslationContainer("commands.generic.usage", usageMessage));
return true;
}
String mode = args[0].toLowerCase();
if (mode.equals("on")) {
Timings.setTimingsEnabled(true);
Timings.reset();
sender.sendMessage(new TranslationContainer("nukkit.command.timings.enable"));
return true;
} else if (mode.equals("off")) {
Timings.setTimingsEnabled(false);
sender.sendMessage(new TranslationContainer("nukkit.command.timings.disable"));
return true;
}
if (!Timings.isTimingsEnabled()) {
sender.sendMessage(new TranslationContainer("nukkit.command.timings.timingsDisabled"));
return true;
}
switch (mode) {
case "verbon":
sender.sendMessage(new TranslationContainer("nukkit.command.timings.verboseEnable"));
Timings.setVerboseEnabled(true);
break;
case "verboff":
sender.sendMessage(new TranslationContainer("nukkit.command.timings.verboseDisable"));
Timings.setVerboseEnabled(true);
break;
case "reset":
Timings.reset();
sender.sendMessage(new TranslationContainer("nukkit.command.timings.reset"));
break;
case "report":
case "paste":
TimingsExport.reportTimings(sender);
break;
}
return true;
}