diff --git a/Java/source/src/main/java/com/yitter/test/StartUp.java b/Java/source/src/main/java/com/yitter/test/StartUp.java index 18a25a4..ad82e9a 100644 --- a/Java/source/src/main/java/com/yitter/test/StartUp.java +++ b/Java/source/src/main/java/com/yitter/test/StartUp.java @@ -23,7 +23,7 @@ public class StartUp { public static void main(String[] args) { IdGeneratorOptions options = new IdGeneratorOptions(); - //options.TopOverCostCount = 10000; + // options.TopOverCostCount = 10000; // options.WorkerIdBitLength = 6; // options.SeqBitLength = 9; @@ -31,8 +31,8 @@ public class StartUp { // options.MaxSeqNumber = 200; options.Method = method; - options.WorkerId = 1; options.StartTime = 1582206693000L; // (2020-2-20) + options.WorkerId = 1; IIdGenerator IdGen = new DefaultIdGenerator(options); GenTest genTest = new GenTest(IdGen, genIdCount, options.WorkerId); @@ -44,13 +44,14 @@ public class StartUp { System.out.println("这是用方法 " + method + " 生成的 Id:" + newId); // 然后循环测试一下,看看并发请求时的耗时情况 - try { + try + { while (true) { genTest.GenStart(); Thread.sleep(1000); // 每隔1秒执行一次GenStart System.out.println("Hello World!"); } - } catch (InterruptedException e) { + } catch (InterruptedException e) { e.printStackTrace(); } } diff --git a/README.md b/README.md index 7ecca91..bd3c919 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,9 @@ 5.哪怕 Guid 能自增,但占用空间大,这也不是你想要的。 -6.你希望系统能运行 100 年以上。 +6.你的应用实例可能超过50个,每个并发请求可能达10W/s。 + +7.你希望系统能运行 100 年以上。 ## 传统算法问题