Back to project page block-composer.
The source code is released under:
MIT License
If you think the Android project block-composer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package bwr.blockcomposer.misc; /* www. ja v a2 s . c om*/ import bwr.blockcomposer.AnimationFinishedListener; public class Timer { private final long duration; private long time = 0; private AnimationFinishedListener listener; public Timer(long duration, AnimationFinishedListener listener) { this.duration = duration; this.listener = listener; } public void update(long dt) { time += dt; if(time >= duration && listener != null) { AnimationFinishedListener tmp = listener; listener = null; tmp.onAnimationFinished(); } } }