Hacker News new | past | comments | ask | show | jobs | submit login

I wish that was true but you can easily see it drifting in Chrome

        let lastms 
        function tick() {
            if (lastms === undefined)
                lastms = new Date().getMilliseconds()
            else if (lastms !== new Date().getMilliseconds()) 
                throw new Error('Drifted')
        }
        setInterval(tick, 1000)



It's only drift if the error grows over time. You need to look at the sum of the offsets.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: