mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
parent
93426fd84e
commit
c65d035cc9
@ -58,5 +58,7 @@ var (
|
||||
func now() int64 {
|
||||
// Use the time duration instead of the current counter to avoid overflow.
|
||||
duration := queryPerformanceCounter() - initCtr
|
||||
return (duration * 1e9) / freq
|
||||
|
||||
// Use float64 not to overflow int64 values (#862).
|
||||
return int64(float64(duration) / float64(freq) * 1e9)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user