There are roughly two type of clocks in most OS.
It is a Clock that cannot be set and represents monotonic time since some unspecified starting point. This clock should be used for calculating elapsed time.
It is a Clock that is more human readable. It keeps on adjusting itself to offset for physical errors in machine's clock with NTP servers. One flaw with these clocks is that it can jump forward and if used to compute elapsed time you might get negative time. (Future has gone).
If your application is time difference sensitive you might want to use monotonic clock else realtime one.
System.nanoTime()resembles monotonic clock and
System.currentTimeMillis()resembles realtime clock.
In python you can use
- Visit github for more