You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
430 B
24 lines
430 B
#include <stdio.h> |
|
#include <uv.h> |
|
|
|
int64_t counter = 0; |
|
|
|
void wait_for_a_while(uv_idle_t* handle) { |
|
counter++; |
|
|
|
if (counter >= 10e6) |
|
uv_idle_stop(handle); |
|
} |
|
|
|
int main() { |
|
uv_idle_t idler; |
|
|
|
uv_idle_init(uv_default_loop(), &idler); |
|
uv_idle_start(&idler, wait_for_a_while); |
|
|
|
printf("Idling...\n"); |
|
uv_run(uv_default_loop(), UV_RUN_DEFAULT); |
|
|
|
uv_loop_close(uv_default_loop()); |
|
return 0; |
|
}
|
|
|