How can I force Javascript to sync Date.now() to the system clock

313 Views Asked by At

I have a Javascript application running on a server that is referencing Date.now() from a Worker thread.

When the system clock on the machine changes I have a (non-JS) application that notices this and accounts for the change.

But the Javascript app takes a long time (circa seconds) before Date.now() starts reporting the changed system clock.

How can I force the Date.now() to reset itself when the app becomes aware of the system clock change?

0

There are 0 best solutions below