public static double currentNanos() { try { return SilenceEngine.display.nanoTime(); } catch (Exception e) { // Can only occur if the time is called without a runtime, that is in class init // So to prevent crashes there, we just ignore the exception and return time based // on the System.currentTimeMillis(), which is a low resolution timer. return convert(System.currentTimeMillis() - STARTING_MILLIS, Unit.MILLIS, Unit.NANOS); } }