Back to project page splott.
The source code is released under:
MIT License
If you think the Android project splott 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 com.wordsaretoys.rise.utility; // ww w . j av a2s . c o m /** * convenience class for generating time deltas */ public class Interval { long time; public Interval() { time = System.nanoTime(); } public float next() { long t = System.nanoTime(); float dt = (float)(t - time) * 1e-9f; time = t; // reject intervals that are too long return (dt < 0.5f) ? dt : 0; } }