Improve performance of System::Time.monotonic on Windows#16555
Improve performance of System::Time.monotonic on Windows#16555straight-shoota wants to merge 7 commits intocrystal-lang:masterfrom
System::Time.monotonic on Windows#16555Conversation
src/crystal/system/win32/time.cr
Outdated
| LibC.QueryPerformanceCounter(out ticks) | ||
| frequency = performance_frequency | ||
| {ticks // frequency, (ticks.remainder(frequency) * NANOSECONDS_PER_SECOND / frequency).to_i32} | ||
| {ticks // frequency, (ticks.remainder(frequency) &* NANOSECONDS_PER_SECOND / frequency).to_i32!} |
There was a problem hiding this comment.
The float division can probably be replaced with an integer one.
Also I would prefer tdiv over // here (or % over remainder) as this way they would have the same sign behavior.
|
Damn, |
|
Are you sure it's The exception seems to come from the event loop. |
|
The problem seems to be that the type of the output parameter |
|
Nice catch. Indeed, it wasn't |
No description provided.