public enum SystemClock extends Enum<SystemClock>
利用ScheduledExecutorService实现高并发场景下System.curentTimeMillis()的性能问题的优化.
| 枚举常量和说明 |
|---|
INSTANCE |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
currentTime()
The get string current time
|
long |
currentTimeMillis()
The get current time milliseconds
|
void |
destroy()
The destroy of executor service
|
void |
initialize()
The initialize scheduled executor service
|
static SystemClock |
valueOf(String name)
返回带有指定名称的该类型的枚举常量。
|
static SystemClock[] |
values()
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。
|
public static final SystemClock INSTANCE
public static SystemClock[] values()
for (SystemClock c : SystemClock.values()) System.out.println(c);
public static SystemClock valueOf(String name)
name - 要返回的枚举常量的名称。IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量NullPointerException - 如果参数为空值public void initialize()
public long currentTimeMillis()
public String currentTime()
public void destroy()
Copyright © 2022. All rights reserved.