mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
audio: time.Sleep to avoid busy loop
This commit is contained in:
parent
f07702746c
commit
681b8ef933
@ -22,6 +22,7 @@ import (
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
"github.com/hajimehoshi/ebiten"
|
||||
"golang.org/x/mobile/exp/audio/al"
|
||||
)
|
||||
|
||||
@ -146,7 +147,7 @@ func (p *player) start() error {
|
||||
// TODO: Record the last error
|
||||
panic(err)
|
||||
}
|
||||
runtime.Gosched()
|
||||
time.Sleep(1 * time.Second / ebiten.FPS / 2)
|
||||
}
|
||||
}()
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user