title: How to sync a javascript countdown with server time
body: <p>I am building a site which has times and prices which tick down. The thing I am most concerned with is syncing time so that it is as accurate as possible across all clients.</p>
  
  <p>Currently, I am sending the client the number of milliseconds left which is then used to fuel the countdown timer, but due to transfer and rendering delays, this can be off by several seconds even with 2 browsers on the same computer.</p>
  
  <p><strong>Is there a way to sync the client's javascript time and server time, or am I just going to have to deal with this slight lag?</strong></p>
  
  <p>If only there was a way to accurately measure the time difference between the server sending the data and it being received and rendered by the client.</p>