Skip to content

Commit

Permalink
Merge pull request #61 from zhangbin1010/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
zhangbinhub authored Aug 4, 2019
2 parents c6c5ebc + cee23e0 commit c8662ef
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,30 @@ void testGenerateSerialNumber() throws InterruptedException {
}
long number1 = generateSerialNumber.getSerialNumber(key, 5000);
System.out.println(CommonTools.getNowTimeString() + " 第二次获取序列号(超时时间5秒):" + number1);
System.out.println("开始循环获取序列号,每次间隔100毫秒,循环60次:");
for (int i = 0; i < 60; i++) {
number1 = generateSerialNumber.getSerialNumber(key, 5000);
System.out.println(CommonTools.getNowTimeString() + " 第" + i + "次获取序列号:" + number1);
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("开始循环获取序列号,同时启动10个线程,每次间隔100毫秒,循环60次:");
for (int t = 0; t < 10; t++) {
new Thread(() -> {
for (int i = 0; i < 60; i++) {
long serialNumber = generateSerialNumber.getSerialNumber(key, 5000);
System.out.println(CommonTools.getNowTimeString() + " 第" + i + "次获取序列号:" + serialNumber);
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
}
// System.out.println("开始循环获取序列号,同时启动10个线程,无限循环取,直到程序结束");
// for (int t = 0; t < 10; t++) {
// new Thread(() -> {
// int i = 0;
// while (true) {
// long serialNumber = generateSerialNumber.getSerialNumber(key, 5000);
// System.out.println(CommonTools.getNowTimeString() + " 第" + (++i) + "次获取序列号:" + serialNumber);
// }
// }).start();
// }
}).start();
Thread.sleep(20000);
}
Expand Down
Binary file modified libs/acp-client-6.1.1.jar
Binary file not shown.
Binary file modified libs/acp-core-6.1.1.jar
Binary file not shown.
Binary file modified libs/acp-packet-6.1.1.jar
Binary file not shown.
Binary file modified libs/acp-spring-boot-starter-6.1.1.jar
Binary file not shown.
Binary file modified libs/acp-spring-cloud-starter-6.1.1.jar
Binary file not shown.

0 comments on commit c8662ef

Please sign in to comment.