mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 08:08:50 +00:00
Remove unneeded semicolons from the core library
This commit is contained in:
+15
-15
@@ -2,36 +2,36 @@ package time
|
||||
|
||||
import win32 "core:sys/windows"
|
||||
|
||||
IS_SUPPORTED :: true;
|
||||
IS_SUPPORTED :: true
|
||||
|
||||
now :: proc() -> Time {
|
||||
file_time: win32.FILETIME;
|
||||
win32.GetSystemTimeAsFileTime(&file_time);
|
||||
ns := win32.FILETIME_as_unix_nanoseconds(file_time);
|
||||
return Time{_nsec=ns};
|
||||
file_time: win32.FILETIME
|
||||
win32.GetSystemTimeAsFileTime(&file_time)
|
||||
ns := win32.FILETIME_as_unix_nanoseconds(file_time)
|
||||
return Time{_nsec=ns}
|
||||
}
|
||||
|
||||
sleep :: proc(d: Duration) {
|
||||
win32.Sleep(win32.DWORD(d/Millisecond));
|
||||
win32.Sleep(win32.DWORD(d/Millisecond))
|
||||
}
|
||||
|
||||
|
||||
|
||||
_tick_now :: proc() -> Tick {
|
||||
mul_div_u64 :: proc(val, num, den: i64) -> i64 {
|
||||
q := val / den;
|
||||
r := val % den;
|
||||
return q * num + r * num / den;
|
||||
q := val / den
|
||||
r := val % den
|
||||
return q * num + r * num / den
|
||||
}
|
||||
|
||||
@thread_local qpc_frequency: win32.LARGE_INTEGER;
|
||||
@thread_local qpc_frequency: win32.LARGE_INTEGER
|
||||
|
||||
if qpc_frequency == 0 {
|
||||
win32.QueryPerformanceFrequency(&qpc_frequency);
|
||||
win32.QueryPerformanceFrequency(&qpc_frequency)
|
||||
}
|
||||
now: win32.LARGE_INTEGER;
|
||||
win32.QueryPerformanceCounter(&now);
|
||||
now: win32.LARGE_INTEGER
|
||||
win32.QueryPerformanceCounter(&now)
|
||||
|
||||
_nsec := mul_div_u64(i64(now), 1e9, i64(qpc_frequency));
|
||||
return Tick{_nsec = _nsec};
|
||||
_nsec := mul_div_u64(i64(now), 1e9, i64(qpc_frequency))
|
||||
return Tick{_nsec = _nsec}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user