title: Different timers for different rooms using Socket.io
body: <p>I found 3 other posts about implementing timers for turn based games but none of them had a final answer.</p>
  
  <p>I am working on a poker game project using WebSockets (Socket.io) rooms.</p>
  
  <p>Each room has a timer which takes care of the turns from the server, for example, each player has 10 seconds to choose a card. If there was only one room I was able to do this by using setInterval and changing the turn variable at the end of each interval and emit the new turn to the clients.</p>
  
  <p>But right now, I am confused how to implement a specific timer for each room when there are a lot of rooms considering that node.js is single threaded.</p>