kochedykov / jlibmodbus

JLibModbus - is an implementation of the Modbus protocol v1.1b in java language. Java modbus library. It works. Welcome.
http://kochedykov.github.io/jlibmodbus/
Apache License 2.0
307 stars 128 forks source link

Use System.nanoTime() instead of System.currentTimeMillis() #62

Closed wielantu closed 3 years ago

wielantu commented 3 years ago

The value of System.currentTimeMillis() might jump if the system wall-clock is changed e.g. by NTP. Therefore it should not be used for measuring elapsed time.

System.nanoTime() is not affected by time steps of the system wall-clock and can better be used for measuring elapsed time.