mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-17 08:34:20 +00:00
Removed int64 -> int downcast in timers.-
On windows when compiling on 32 bit, this can get you a out of range exception for an otherwise valid interval.
This commit is contained in:
committed by
Patrick Kelley
parent
a853d9c3e3
commit
2abf3b717a
@@ -27,9 +27,9 @@ when defined(windows):
|
||||
proc `-`(a, b: TTicks): TNanos =
|
||||
var frequency: int64
|
||||
QueryPerformanceFrequency(frequency)
|
||||
var performanceCounterRate = 1000000000.0 / toFloat(frequency.int)
|
||||
var performanceCounterRate = 1e+9'f64 / float64(frequency)
|
||||
|
||||
result = ((a.int64 - b.int64).int.toFloat * performanceCounterRate).TNanos
|
||||
result = TNanos(float64(a.int64 - b.int64) * performanceCounterRate)
|
||||
|
||||
elif defined(macosx):
|
||||
type
|
||||
|
||||
Reference in New Issue
Block a user