SystemnanoTime
System.nanoTime is a method in the Java standard library (java.lang.System) that provides access to a high-resolution timer. It returns a long value representing nanoseconds elapsed on a monotonic timer with an arbitrary origin. The value is not related to wall-clock time or the epoch, and should not be used as a timestamp for logging or event times.
Because the origin is arbitrary, the number cannot be interpreted as a real-world clock reading. It is
Usage is straightforward: capture two readings and subtract to obtain elapsed time in nanoseconds. For example,
Notes and limitations: the actual timer resolution depends on the underlying operating system and hardware, so
See also: System.currentTimeMillis, monotonic clocks in other environments.