当前位置:网站首页>Réglez la hauteur et lancez le système. Currenttimemillis catton
Réglez la hauteur et lancez le système. Currenttimemillis catton
2022-07-03 03:11:00 【Années d'amitié】
public class SystemClock {
private final int period;
private final AtomicLong now;
private static class InstanceHolder {
private static final SystemClock INSTANCE = new SystemClock(1);
}
private SystemClock(int period) {
this.period = period;
this.now = new AtomicLong(System.currentTimeMillis());
scheduleClockUpdating();
}
private static SystemClock instance() {
return InstanceHolder.INSTANCE;
}
private void scheduleClockUpdating() {
ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(runnable -> {
Thread thread = new Thread(runnable, "System Clock");
thread.setDaemon(true);
return thread;
});
scheduler.scheduleAtFixedRate(() -> now.set(System.currentTimeMillis()), period, period, TimeUnit.MILLISECONDS);
}
private long currentTimeMillis() {
return now.get();
}
/**
* Pour remplacer l'original System.currentTimeMillis()
*/
public static long now() {
return instance().currentTimeMillis();
}
边栏推荐
- labelimg生成的xml文件转换为voc格式
- Can netstat still play like this?
- Spark on yarn资源优化思路笔记
- TCP 三次握手和四次挥手机制,TCP为什么要三次握手和四次挥手,TCP 连接建立失败处理机制
- Le processus de connexion mysql avec docker
- [C语言]给账号密码进行MD5加密
- Force deduction ----- the minimum path cost in the grid
- Idea set method call ignore case
- 模型转换onnx2engine
- Add automatic model generation function to hade
猜你喜欢

Do you really understand relays?

左连接,内连接

Check log4j problems using stain analysis

Joking about Domain Driven Design (III) -- Dilemma

Kubernetes family container housekeeper pod online Q & A?
![MySQL practice 45 lecture [transaction isolation]](/img/a5/5420651d6be51e892976f02be8c43c.png)
MySQL practice 45 lecture [transaction isolation]

MySql实战45讲【行锁】

分布式事务

Opengauss database development and debugging tool guide

别再用 System.currentTimeMillis() 统计耗时了,太 Low,StopWatch 好用到爆!
随机推荐
How to make backgroundworker return an object
I2C 子系统(一):I2C spec
BigVision代码
What happens between entering the URL and displaying the page?
Check log4j problems using stain analysis
el-tree搜索方法使用
Super easy to use logzero
Last update time of all sqlserver tables
I2C subsystem (IV): I2C debug
模型转换onnx2engine
Add automatic model generation function to hade
yii2 中andWhere多个or查询 orm条件
How to use asp Net MVC identity 2 change password authentication- How To Change Password Validation in ASP. Net MVC Identity 2?
基于Qt的yolov5工程
[shutter] monitor the transparency gradient of the scrolling action control component (remove the blank of the top status bar | frame layout component | transparency component | monitor the scrolling
Update and return document in mongodb - update and return document in mongodb
Installation and use of memory leak tool VLD
Le processus de connexion mysql avec docker
Parameter index out of range (1 > number of parameters, which is 0)
Change cell color in Excel using C - cell color changing in Excel using C