Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void increment() {
- long now = System.currentTimeMillis();
- accumulatedMilliseconds = now - startTime;
- if (accumulatedMilliseconds >= 1000) {
- sec += 1;
- accumulatedMilliseconds = 0;
- startTime = System.currentTimeMillis();
- }
- if (sec >= 60) {
- min += 1;
- sec = 0;
- accumulatedMilliseconds = 0;
- startTime = System.currentTimeMillis();
- }
- updateTimeView();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement