?? nanosecond NS (nanosecond): nanoseconds,Time Unit。 One of the 1 billion points in a second, which equals 10 minus 9 seconds.
A unit that is often used as a memory read/write speed, the lower the number, the faster.
1 nanoseconds =1000Leather seconds1 nanoseconds =0.001microseconds1 nanoseconds =0.000001milliseconds
1 nanoseconds =0.00000 0001 sec
What is the difference between Java's System.currenttimemillis () and System.nanotime ()
In Java, System.nanotime () returns nanoseconds. Nanotime and return may be random time, even may be negative ... Follow the API's instructions. The basic use of nanotime is to measure a period of time, such as the time it takes to run a code, the time it takes to get a database connection, the time it takes to access the network, and so on. Other than that. Nanotime provides the nanosecond level of precision, but the actual value obtained may not be accurate to nanoseconds.
but in general, the purpose of these two functions is completely different! .
The milliseconds that System.currenttimemillis () returns in Java, which in fact is the number of milliseconds since 0 o'clock January 1, 1970. Date () is actually equivalent to date (System.currenttimemillis ()), because the date class has a constructed date (long date). Used to calculate the millisecond difference between long seconds and January 1, 1970.
。
[JAVA] more precise timestamp (nanometer timestamp) than millisecond system.currenttimemillis ()