Friday 28 December 2018

java - How to measure time elapsed, immune to system time server automatic updates

My servers and desktops are configured to automatically adjust their time via network ntp time servers.



This means that if I use the easy method beginDate.getTime()-new Date().getTime(), there is a chance I'm not getting an accurate number of elapsed milliseconds.




How can I write code that is immune to system clock updates and leap second adjustments?

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...