package speiger.src.coreengine.utils.counters.timers;

import speiger.src.coreengine.utils.counters.averager.Counter;

public class TimerTarget {
	int targetTicks;
	long targetNS;
	Counter counter = new Counter();
	
	public TimerTarget(int defaultValue) {
		setTarget(defaultValue);
	}
	
	public void setTarget(int targetTicks) {
		this.targetTicks = targetTicks;
		targetNS = 1000000000L / targetTicks;
	}
	
	public int getTargetTicks() { return targetTicks; }
	public long getTargetNS() { return targetNS; }
	
	public void tick() { counter.add(1); }
	public void update() { counter.onFinished(); }
	public int getTicks() { return counter.get(); }
}