Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. private void increment() {
  2.         long now = System.currentTimeMillis();
  3.         accumulatedMilliseconds = now - startTime;
  4.         if (accumulatedMilliseconds >= 1000) {
  5.             sec += 1;
  6.             accumulatedMilliseconds = 0;
  7.             startTime = System.currentTimeMillis();
  8.         }
  9.         if (sec >= 60) {
  10.             min += 1;
  11.             sec = 0;
  12.             accumulatedMilliseconds = 0;
  13.             startTime = System.currentTimeMillis();
  14.         }
  15.         updateTimeView();
  16.  
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement