File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -53,15 +53,16 @@ module Crystal::System::Time
5353 ((filetime.dwHighDateTime.to_u64 << 32 ) | filetime.dwLowDateTime.to_u64).to_f64 / FILETIME_TICKS_PER_SECOND .to_f64
5454 end
5555
56- private class_getter performance_frequency : Int64 do
56+ private def self. performance_frequency
5757 LibC .QueryPerformanceFrequency (out frequency)
5858 frequency
5959 end
6060
6161 def self.monotonic : {Int64 , Int32 }
6262 LibC .QueryPerformanceCounter (out ticks)
6363 frequency = performance_frequency
64- {ticks // frequency, (ticks.remainder(frequency) * NANOSECONDS_PER_SECOND / frequency).to_i32}
64+ divmod = ticks.tdivmod(frequency)
65+ {divmod[0 ], (divmod[1 ] &* NANOSECONDS_PER_SECOND // frequency).to_i32!}
6566 end
6667
6768 def self.ticks : UInt64
You can’t perform that action at this time.
0 commit comments