mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-27 19:22:49 +01:00
parent
93426fd84e
commit
c65d035cc9
@ -58,5 +58,7 @@ var (
|
|||||||
func now() int64 {
|
func now() int64 {
|
||||||
// Use the time duration instead of the current counter to avoid overflow.
|
// Use the time duration instead of the current counter to avoid overflow.
|
||||||
duration := queryPerformanceCounter() - initCtr
|
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