本文整理汇总了Java中co.aikar.timings.TimingsExport.reportTimings方法的典型用法代码示例。如果您正苦于以下问题:Java TimingsExport.reportTimings方法的具体用法?Java TimingsExport.reportTimings怎么用?Java TimingsExport.reportTimings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类co.aikar.timings.TimingsExport
的用法示例。
在下文中一共展示了TimingsExport.reportTimings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import co.aikar.timings.TimingsExport; //导入方法依赖的package包/类
public void execute(DragonProxy proxy, String[] args) {
if (args.length == 0)
{
proxy.getLogger().info("Timings command (start / stop / paste / history)");
}
else
{
switch(args[0])
{
case "start":
Timings.setTimingsEnabled(true);
proxy.getLogger().info("Timings started !");
break;
case "stop":
Timings.setTimingsEnabled(false);
proxy.getLogger().info("Timings stopped !");
break;
case "reset":
Timings.reset();
proxy.getLogger().info("Timings reseted !");
break;
case "paste":
TimingsExport.reportTimings(null);
break;
case "history":
break;
}
}
}
示例2: execute
import co.aikar.timings.TimingsExport; //导入方法依赖的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;
}