Package org.aoju.bus.core.date
Class NonClock
java.lang.Object
org.aoju.bus.core.date.NonClock
通用、系统时钟 高并发场景下System.currentTimeMillis()的性能问题的优化
System.currentTimeMillis()的调用比new一个普通对象要耗时的多(具体耗时高出多少我还没测试过,有人说是100倍左右) System.currentTimeMillis()之所以慢是因为去跟系统打了一次交道
后台定时更新时钟,JVM退出时,线程自动回收
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Method Summary
-
Method Details
-
now
public static long now()- Returns:
- 当前时间
-
nowDate
- Returns:
- 当前时间字符串表现形式
-