Reduce latency of poll() on Windows

When polling sockets poll() can now let you know about an event in about
10µs rather than 10ms. If you're not polling sockets then poll() reports
console events now in microseconds instead of milliseconds.
This commit is contained in:
Justine Tunney 2024-09-10 04:12:21 -07:00
parent a0a404a431
commit cceddd21b2
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
5 changed files with 489 additions and 18 deletions

View file

@ -89,7 +89,7 @@ int main(int argc, char *argv[]) {
// not the case when you use sigprocmask() to block signals which is
// useful for kicking the can down the road.
WRITE("doing cpu task...\n");
for (volatile int i = 0; i < INT_MAX / 5; ++i) {
for (volatile int i = 0; i < INT_MAX / 3; ++i) {
if (gotsig) {
WRITE("\rgot ctrl+c asynchronously\n");
exit(0);