/** * Get the accurate system time * * @return The system time in milliseconds */ public static long getTime() { return (Sys.getTime() * 1000) / Sys.getTimerResolution(); } private static long lastFPS; private static long recordedFPS; private static long fps; /** * Updated the FPS counter */ public static void updateFPS() { if (getTime() - lastFPS > 1000) { lastFPS = getTime(); recordedFPS = fps; fps = 0; System.out.println("FPS: "+recordedFPS); } fps++; }