mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-18 05:16:12 +00:00
33 lines
578 B
Java
33 lines
578 B
Java
|
package me.totalfreedom.totalfreedommod.util;
|
||
|
|
||
|
public class MethodTimer
|
||
|
{
|
||
|
|
||
|
private long lastStart;
|
||
|
private long total = 0;
|
||
|
|
||
|
public MethodTimer()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
public void start()
|
||
|
{
|
||
|
this.lastStart = System.currentTimeMillis();
|
||
|
}
|
||
|
|
||
|
public void update()
|
||
|
{
|
||
|
this.total += (System.currentTimeMillis() - this.lastStart);
|
||
|
}
|
||
|
|
||
|
public long getTotal()
|
||
|
{
|
||
|
return this.total;
|
||
|
}
|
||
|
|
||
|
public void printTotalToLog(String timerName)
|
||
|
{
|
||
|
FLog.info("DEBUG: " + timerName + " used " + this.getTotal() + " ms.");
|
||
|
}
|
||
|
}
|