server/simulation_timing.go (390B)
1 package main 2 3 import ( 4 "log" 5 "time" 6 ) 7 8 func reportSimulationTick(playfield uint32, name string, scheduled, started time.Time) { 9 delay, elapsed := started.Sub(scheduled), time.Since(started) 10 if delay >= 100*time.Millisecond || elapsed >= 100*time.Millisecond { 11 log.Printf("Slow simulation tick: playfield=%d phase=%s delay=%s elapsed=%s", playfield, name, max(0, delay), elapsed) 12 } 13 }