Browse Source

在循环获取下一时间戳时,暂停1ms

tags/v1.3.1
yitter 2 years ago
parent
commit
848cd3bb6f
2 changed files with 2 additions and 0 deletions
  1. +1
    -0
      C#.NET/source/Yitter.IdGenerator/Core/SnowWorkerM1.cs
  2. +1
    -0
      Java/source/src/main/java/com/github/yitter/core/SnowWorkerM1.java

+ 1
- 0
C#.NET/source/Yitter.IdGenerator/Core/SnowWorkerM1.cs View File

@@ -351,6 +351,7 @@ namespace Yitter.IdGenerator
while (tempTimeTicker <= _LastTimeTick)
{
Thread.Sleep(1);
tempTimeTicker = GetCurrentTimeTick();
}


+ 1
- 0
Java/source/src/main/java/com/github/yitter/core/SnowWorkerM1.java View File

@@ -214,6 +214,7 @@ public class SnowWorkerM1 implements ISnowWorker {
long tempTimeTicker = GetCurrentTimeTick();
while (tempTimeTicker <= _LastTimeTick) {
Thread.sleep(1);
tempTimeTicker = GetCurrentTimeTick();
}


Loading…
Cancel
Save