diff --git a/C#.NET/source/Yitter.IdGenerator/Core/SnowWorkerM1.cs b/C#.NET/source/Yitter.IdGenerator/Core/SnowWorkerM1.cs index 4344b5f..5671349 100644 --- a/C#.NET/source/Yitter.IdGenerator/Core/SnowWorkerM1.cs +++ b/C#.NET/source/Yitter.IdGenerator/Core/SnowWorkerM1.cs @@ -351,6 +351,7 @@ namespace Yitter.IdGenerator while (tempTimeTicker <= _LastTimeTick) { + Thread.Sleep(1); tempTimeTicker = GetCurrentTimeTick(); } diff --git a/Java/source/src/main/java/com/github/yitter/core/SnowWorkerM1.java b/Java/source/src/main/java/com/github/yitter/core/SnowWorkerM1.java index 52f6ff4..3e52171 100644 --- a/Java/source/src/main/java/com/github/yitter/core/SnowWorkerM1.java +++ b/Java/source/src/main/java/com/github/yitter/core/SnowWorkerM1.java @@ -214,6 +214,7 @@ public class SnowWorkerM1 implements ISnowWorker { long tempTimeTicker = GetCurrentTimeTick(); while (tempTimeTicker <= _LastTimeTick) { + Thread.sleep(1); tempTimeTicker = GetCurrentTimeTick(); }