mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-20 03:18:30 +00:00
Improve Windows sleep accuracy from 15ms to 15µs
This commit is contained in:
parent
b40140e6c5
commit
b490e23d63
16 changed files with 189 additions and 67 deletions
18
libc/nt/ntdll/NtSetTimerResolution.S
Normal file
18
libc/nt/ntdll/NtSetTimerResolution.S
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include "libc/nt/ntdllimport.h"
|
||||
.ntimp NtSetTimerResolution,NtSetTimerResolution
|
||||
|
||||
.text.windows
|
||||
.ftrace1
|
||||
NtSetTimerResolution:
|
||||
.ftrace2
|
||||
#ifdef __x86_64__
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
mov __imp_NtSetTimerResolution(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
#elif defined(__aarch64__)
|
||||
mov x0,#0
|
||||
ret
|
||||
#endif
|
||||
.endfn NtSetTimerResolution,globl
|
||||
.previous
|
Loading…
Add table
Add a link
Reference in a new issue