Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package RevampClient.utils;
- public class TimeHelper {
- private static long LastMS = 0L;
- public boolean isDelayComplete(float f) {
- if(System.currentTimeMillis() - this.LastMS >= f) {
- return true;
- }
- return false;
- }
- public static long getCurrentMS() {
- return System.nanoTime() / 10000000L;
- }
- 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();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement