From 777d2d2257b777c70e26b2092e68e2b666a2da20 Mon Sep 17 00:00:00 2001 From: flswld Date: Thu, 5 Jan 2023 17:33:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E6=97=B6=E6=94=BE=E5=AE=BD=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E7=B2=BE=E5=BA=A6=EF=BC=8C=E9=99=8D=E4=BD=8Ecpu?= =?UTF-8?q?=E5=8D=A0=E6=9C=89=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gs/game/audio_player.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gs/game/audio_player.go b/gs/game/audio_player.go index 8584a98d..efae252f 100644 --- a/gs/game/audio_player.go +++ b/gs/game/audio_player.go @@ -42,8 +42,8 @@ func RunPlayAudio() { for _, event := range track { // 单个轨道 delay := uint32(float64(event.Delta) * tickTime) - busyPoolWaitMilliSecond(delay) - // interruptWaitMilliSecond(delay) + // busyPollWaitMilliSecond(delay) + interruptWaitMilliSecond(delay) totalTick += uint64(delay) msg := event.Message @@ -79,7 +79,7 @@ func interruptWaitMilliSecond(delay uint32) { time.Sleep(time.Millisecond * time.Duration(delay)) } -func busyPoolWaitMilliSecond(delay uint32) { +func busyPollWaitMilliSecond(delay uint32) { start := time.Now() end := start.Add(time.Millisecond * time.Duration(delay)) for {