title: Javascript multi-timers/rooms
body: <p>So I'm attempting to make a timer system and controller that puts out ticks which can be used to synchronize users' videos/music to a timer. The version I have works and I hooked it up backend to work with sockets, however now I want to make a way to create multiple timers so I can create a room system out of it. Any ideas how I would go about that with what I have? This version works in console btw.  Don't worry about the sockets part, I already got that taken care of in my fuller version.</p>
  
  <pre><code>var count1 = 0;
  var interval;
  var videoTime = 20;
  
  function checkTimer() {
  if (count1 &gt; videoTime + 3) {
  restartPause();
  
  }
  }
  
  //reset timer
  function restart() {
  pause();
  count1 = 0; interval = setInterval(function() {console.log(count1); count1++; checkTimer()}, 1000);
  }
  
  //pause timer
  function pause() {
    clearInterval(interval);
  }
  
  //play timer
  function start() {
    pause();
    interval = setInterval(function() {console.log(count1); count1++;     
   checkTimer()}, 1000);
  }
  
  //Restart and Pause, for when the video ends
  function restartPause() {
  restart();
  pause();
  }
  </code></pre>