Portl

Untitled

Oct 3rd, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. package me.fulpix.plastic.utils;
  2.  
  3. public class TimeHelper {
  4.  
  5. private static long lastMS =0L;
  6.  
  7. public boolean isDelayComplete(float f) {
  8. if(System.currentTimeMillis() - this.lastMS >= f) {
  9.  
  10. }
  11. return false;
  12. }
  13.  
  14. public static long getCurrentMS() {
  15. return System.nanoTime() / 100000L;
  16. }
  17.  
  18. public void setLastMS(long LastMS) {
  19. this.lastMS = System.currentTimeMillis();
  20. }
  21.  
  22. public int convertToMS(int perSecond) {
  23. return 1000 / perSecond;
  24. }
  25.  
  26. public static boolean hasReached(long milliseconds) {
  27. return getCurrentMS() - lastMS >= milliseconds;
  28. }
  29.  
  30. public static void reset() {
  31. lastMS = getCurrentMS();
  32. }
  33.  
  34. }
Add Comment
Please, Sign In to add comment