package main; public class EffectTimer { private Effect effect; private long duration; private long startTime; public EffectTimer(Effect effect, long duration) { this.effect = effect; this.duration = duration; this.startTime = System.currentTimeMillis(); } public Effect getEffect() { return this.effect; } public boolean expired() { return (System.currentTimeMillis() - this.startTime >= this.duration); } }