1
0
mirror of synced 2026-04-03 10:08:42 +08:00

go实现,获取下一时间戳前,暂停1ms

This commit is contained in:
yitter
2022-07-09 20:21:55 +08:00
parent 848cd3bb6f
commit c916112dd7
3 changed files with 21 additions and 8 deletions

View File

@@ -232,6 +232,7 @@ func (m1 *SnowWorkerM1) GetCurrentTimeTick() int64 {
func (m1 *SnowWorkerM1) GetNextTimeTick() int64 {
tempTimeTicker := m1.GetCurrentTimeTick()
for tempTimeTicker <= m1._LastTimeTick {
time.Sleep(time.Duration(1) * time.Millisecond)
tempTimeTicker = m1.GetCurrentTimeTick()
}
return tempTimeTicker