mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-13 04:22:05 +01:00
ui: Change the threshold to determine if the running is busy
This commit is contained in:
parent
db2a43217e
commit
522b7370a4
6
run.go
6
run.go
@ -106,9 +106,9 @@ func Run(f func(*Image) error, width, height, scale int, title string) error {
|
|||||||
if int64(5*time.Second/60) < now-beforeForUpdate {
|
if int64(5*time.Second/60) < now-beforeForUpdate {
|
||||||
beforeForUpdate = now
|
beforeForUpdate = now
|
||||||
} else {
|
} else {
|
||||||
c := int((now - beforeForUpdate) * 60 / int64(time.Second))
|
c := float64(now-beforeForUpdate) * 60 / float64(time.Second)
|
||||||
runContext.isRunningSlowly = c >= 2
|
runContext.isRunningSlowly = c >= 2.5
|
||||||
for i := 0; i < c; i++ {
|
for i := 0; i < int(c); i++ {
|
||||||
if err := ui.DoEvents(); err != nil {
|
if err := ui.DoEvents(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user