NodeGuy / server-date

Make the server's clock available in the browser.

Home Page:http://www.nodeguy.com/serverdate/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

not accurate at all

greg606 opened this issue · comments

i need to sync clients. but your functions shows two different times (1s diff) in two browsers (on one computer)
unless i do something wrong and then maybe you could correct me. i have seconds based sessions and 1s difference is huge.
I would be grateful for any advice how to make timers accurate (each start at the same server time )

Game.toFullSecond = 1000 - ServerDate.getMilliseconds();
        setTimeout(function () {
            timer = new CountDownTimer(seconds);
        }, Game.toFullSecond);

Try looking at the messages in the JavaScript console of each browser for more information about what's going on.