Advertisement
defango

immortaljub2l6ib.onion/onlineTime.js

Aug 26th, 2018
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var h1 = document.getElementsByTagName('t')[0],
  2. seconds = 0, minutes = 0, hours = 0,
  3. t;
  4.  
  5. function add() {
  6. seconds++;
  7. if (seconds >= 60) {
  8. seconds = 0;
  9. minutes++;
  10. if (minutes >= 60) {
  11. minutes = 0;
  12. hours++;
  13. }
  14. }
  15.  
  16. h1.textContent = (hours ? (hours > 9 ? hours : "0" + hours) : "00") + ":" + (minutes ? (minutes > 9 ? minutes : "0" + minutes) : "00") + ":" + (seconds > 9 ? seconds : "0" + seconds);
  17.  
  18. timer();
  19. }
  20.  
  21. function timer() {
  22. t = setTimeout(add, 1000);
  23. }
  24. timer();
  25. /* We're always watching */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement