package com.dawreh.wickeddreams.main; /** * Created by Dawood on 2016-08-05. */ public class GameClock { private long t0; private long t1; private long elapsedTime; private final long nanoSecond = 1000000000; private final long gamePlayRate = 1000000000/30; public long Initialize() { t0 = System.nanoTime(); return t0; } public long CalculateElapsedTimeNS() { t1 = System.nanoTime(); elapsedTime = t1 - t0; t0 = t1; return elapsedTime; } public long getGamePlayRate() { return gamePlayRate; } public long getCurrentTime() { return System.nanoTime(); } }