package me.nallar.tickthreading.minecraft.commands;

import java.util.List;

import me.nallar.tickthreading.minecraft.TickManager;
import me.nallar.tickthreading.minecraft.TickThreading;
import net.minecraft.command.ICommandSender;

public class TPSCommand extends Command {
	public static String name = "tps";

	@Override
	public String getCommandName() {
		return name;
	}

	@Override
	public boolean canCommandSenderUseCommand(ICommandSender par1ICommandSender) {
		return true;
	}

	@Override
	public void processCommand(ICommandSender commandSender, List<String> arguments) {
		StringBuilder tpsReport = new StringBuilder();
		tpsReport.append("---- TPS Report ----\n");
		long usedTime = 0;
		for (TickManager tickManager : TickThreading.instance().getManagers()) {
			tpsReport.append(tickManager.getBasicStats());
			usedTime += tickManager.lastTickLength;
		}
		tpsReport.append("\nOverall TPS: ").append(Math.min(20, 1000 / usedTime))
				.append("\nOverall load: ").append(usedTime / 0.5).append('%');
		sendChat(commandSender, tpsReport.toString());
	}
}

@@ -957,24 +957,25 @@
  1000 / 
+(
 usedTime
 ))%0D%0A%09%09%09%09
@@ -966,16 +966,37 @@
 usedTime
+ == 0 ? 1 : usedTime)
 ))%0D%0A%09%09%09%09
@@ -1043,13 +1043,11 @@
 ime 
-/ 0.5
+* 2
 ).ap

Fix for / by 0 in /tps