0

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?

William
  • 20,150
  • 8
  • 49
  • 91
  • `the Javascript app` - so, not a browser? – Bravo May 12 '22 at 06:48
  • Actually the JS app is running in a browser on that machine. – William May 12 '22 at 06:55
  • then the issue is with the browser being slow to react to time changes - absolutely nothing your web page can do about that (not sure what a `JS App in browser` is – Bravo May 12 '22 at 07:27
  • Its an Angular app running in the browser. The app knows that the SysClock has changed because it has received notification from another app. Is there anyway to tell the browser or JS container to reload/resync the system clock? – William May 12 '22 at 08:06
  • No, a web page can't tell the browser to resync the time - which browser is it? Firefox reacts immediately to the system clock changing time – Bravo May 12 '22 at 08:11
  • note: `Angular App` is still just a web page – Bravo May 12 '22 at 08:18
  • Chrome 101.0.4951.54 – William May 13 '22 at 00:17
  • What OS. it may be an OS thing rather than a browser thing ... but knowing how Chrome is .... anyway, can you check if this reaction to system clock change is as retarded in Firefox. Also check any other browser you have - see if it's browser related - if you find it's just Chrome (and chrome base browsers like Edge for example) then I'll add this to my list of "reasons to never use Chrome again" list - it's a BIG list – Bravo May 13 '22 at 00:21

0 Answers0