Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.fulpix.plastic.utils;
- public class TimeHelper {
- private static long lastMS =0L;
- public boolean isDelayComplete(float f) {
- if(System.currentTimeMillis() - this.lastMS >= f) {
- }
- return false;
- }
- public static long getCurrentMS() {
- return System.nanoTime() / 100000L;
- }
- public void setLastMS(long LastMS) {
- this.lastMS = System.currentTimeMillis();
- }
- public int convertToMS(int perSecond) {
- return 1000 / perSecond;
- }
- public static boolean hasReached(long milliseconds) {
- return getCurrentMS() - lastMS >= milliseconds;
- }
- public static void reset() {
- lastMS = getCurrentMS();
- }
- }
Add Comment
Please, Sign In to add comment