Nanosecond
NS (nanosecond): nanosecond,
Time unit. One billionth of a second is equal to the minus ninth power of 10. Commonly used as
A unit of memory read-write speed. The smaller the number in front of it, the faster it is.
1 nanosecond = 1000
Picosecond
1 ns = 0.001
Microsecond
1 ns = 0.00000 1
millisecond
1 nanosecond = 0.00000 0001 seconds
What is the difference between system. Currenttimemillis() and system. Nanotime() in Java
In Java, system. Nanotime() returns nanoseconds, and nanotime may return any time, or even negative numbers… According to the API, the main purpose of nanotime is to measure a period of time, such as the time for a code execution, the time for database connection, the time for network access, etc. In addition, nanotime provides nanosecond precision, but the actual value may not be accurate to nanosecond
But in general, these two functions are used for different purposes
The MS returned by system. Currenttimemillis() in Java is actually the number of MS since 0:00 on January 1, 1970. Date() is actually equivalent to date (system. Currenttimemillis()); Because the date class also constructs a date (long date) to calculate the millisecond difference between long seconds and January 1, 1970
Similar Posts:
- MySQL from_ Unixtime() and UNIX_ The difference of timestamp() function
- Weblogic “ThreadPool has stuck threads” [How to Solve]
- Spring @Async interrupt/Unable to acquire JDBC Connection
- [Solved] mapper.xml Error: java.lang.AbstractMethodError: Method oracle/jdbc/driver/OracleResultSetImpl.getNString(Ljava/lang/String;)Ljava/lang/String; is abstract,
- The jdbc driver imported from idea into MySQL appears “Java. Lang. classnotfoundexception: com. Mysql. CJ. JDBC. Driver”
- Get the time value from the database and report an error: Java sql. Timestamp cannot be cast to java. lang.Long
- [Solved] SOAP-ERROR failed to load external entity
- How to solve the problem of “no observations” in Stata?
- Javassist Compile Error: Type long_2nd (current frame, stack[2]) is not assignable to ‘java/lang/Long’
- MySql Host is blocked because of many connection errors; unblock with ‘mysqladmin flush-hosts…