1
0
mirror of synced 2025-11-06 03:20:55 +08:00

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

This commit is contained in:
yitter
2022-07-08 15:58:48 +08:00
parent 72cdb85d1d
commit 848cd3bb6f
2 changed files with 2 additions and 0 deletions

View File

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

View File

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