mirror of
https://github.com/GTNewHorizons/Opis.git
synced 2026-11-18 19:39:10 +00:00
28 lines
676 B
Java
28 lines
676 B
Java
package mcp.mobius.opis.data.server;
|
|
|
|
import mcp.mobius.mobiuscore.profiler.IProfilerTick;
|
|
import mcp.mobius.opis.data.holders.stats.StatsTick;
|
|
|
|
public class TickProfiler extends AbstractProfiler implements IProfilerTick {
|
|
|
|
private static TickProfiler _instance = new TickProfiler();
|
|
public static TickProfiler instance() {return _instance;}
|
|
|
|
private Clock clock = new Clock();
|
|
public StatsTick stats = new StatsTick();
|
|
public int profiledTicks = 0;
|
|
|
|
@Override
|
|
public void TickStart() {
|
|
this.clock.start();
|
|
}
|
|
|
|
@Override
|
|
public void TickEnd() {
|
|
this.clock.stop();
|
|
this.stats.addMeasure(this.clock.timeDelta);
|
|
this.profiledTicks += 1;
|
|
}
|
|
|
|
}
|