Improve time/sleep accuracy on Windows

It's now almost as good as Linux thanks to a Windows 8+ API.
This commit is contained in:
Justine Tunney 2023-11-18 01:57:44 -08:00
parent 72ac5f18d9
commit 8caf1b48a9
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
9 changed files with 76 additions and 31 deletions

View file

@ -65,7 +65,7 @@ static textwindows int sys_utimensat_nt_impl(int dirfd, const char *path,
}
if (!ts || ts[0].tv_nsec == UTIME_NOW || ts[1].tv_nsec == UTIME_NOW) {
GetSystemTimeAsFileTime(ft);
GetSystemTimePreciseAsFileTime(ft);
}
if (ts) {
for (i = 0; i < 2; ++i) {