audio: time.Sleep to avoid busy loop

This commit is contained in:
Hajime Hoshi 2016-03-14 00:07:31 +09:00
parent f07702746c
commit 681b8ef933

View File

@ -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