当前位置:网站首页>long start = currentTimeMillis();
long start = currentTimeMillis();
2022-06-22 05:16:00 【a good idea】
package currentTimeMillis;
import java.util.Random;
import static java.lang.System.currentTimeMillis;
import static java.lang.Thread.sleep;
public class TaskMethodProvider {
private static Random random = new Random();
public void taskOne() throws Exception {
System.out.println(" Start task one ");
long start = currentTimeMillis();
sleep(random.nextInt(10000));
long end = currentTimeMillis();
System.out.println(" Complete task one , Time consuming :" + (end - start) + " millisecond ");
}
public void taskTwo() throws Exception {
System.out.println(" Start task two ");
long start = currentTimeMillis();
sleep(random.nextInt(10000));
long end = currentTimeMillis();
System.out.println(" Finish task two , Time consuming :" + (end - start) + " millisecond ");
}
public void taskThree() throws Exception {
System.out.println(" Start task three ");
long start = currentTimeMillis();
sleep(random.nextInt(10000));
long end = currentTimeMillis();
System.out.println(" Complete task three , Time consuming :" + (end - start) + " millisecond ");
}
}
边栏推荐
- 使用选择法对十个整数进行排序
- A domestic developer opened the "programmer's Guide to cooking" and became popular!
- 7. Gateway global filter
- CS 611 Game
- YARN 的高可用设计有哪些?
- How to display loading animation when requesting data
- flink部署模式(二)- yarn三种部署模式
- C语言变量的存储方式和生存期
- 9 practical shell scripts, recommended collection!
- C语言数据类型转换规则(隐式转换+显式转换)
猜你喜欢

Sort ten integers using selection

liunx虚拟机环境使用docker安装oracle数据库,并使用navicat连接

毕业回馈!Apache Doris 社区所有贡献者来领礼品啦!

Graduation feedback! All contributors of Apache Doris community come to receive gifts!

6. Local - custom filter factory

8. Gateway request logging

Progress warning and problem management of progress control in Zhiyuan project management SPM system

Virtual address space

加快推进工业互联网,图扑“智”绘发展新蓝图

7. Gateway global filter
随机推荐
Reconstructing thinking series 2-functions and variables
在Vs Code中搭建JSP开发环境
Contents of 2022 tea master (intermediate) examination and tea master (intermediate) examination
Flink deployment mode (I) - standalone and Application
Idea创建方法时,使用注解提示方法参数(param)、返回值(return)、方法作用(Description)
Fancy optimizer finishing
C语言数据类型转换规则(隐式转换+显式转换)
DTS迁移秘籍-SQLSERVER篇
Remote Dictionary Server(Redis)——基于 KV 结构的作为 Cache 使用的 NoSQL 数据库管理系统
C language data type conversion rules (implicit conversion + explicit conversion)
postmanUtils工具类,模拟postman的get,post请求
flink部署模式总结
MySQL day03 class notes
Rétroaction sur la remise des diplômes! Tous les contributeurs de la communauté Apache Doris sont ici pour recevoir des cadeaux!
It is easy to analyze and improve R & D efficiency by understanding these five figures
jedispool工具类
What is cloud hosting and what are its advantages?
In 2022, the third batch (principal) of Guangdong Provincial Safety Officer a certificate was found and analyzed, and the third batch (principal) of Guangdong Provincial Safety Officer a certificate w
Flink deployment mode (II) - three deployment modes of yarn
YARN 的高可用设计有哪些?