Mercurial
annotate third_party/libuv/docs/code/idle-basic/main.c @ 207:58d9b64d8dca
Updated deployment script to include sqlite3
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Sun, 15 Feb 2026 12:25:50 -0800 |
| parents | 948de3f54cea |
| children |
| rev | line source |
|---|---|
| 160 | 1 #include <stdio.h> |
| 2 #include <uv.h> | |
| 3 | |
| 4 int64_t counter = 0; | |
| 5 | |
| 6 void wait_for_a_while(uv_idle_t* handle) { | |
| 7 counter++; | |
| 8 | |
| 9 if (counter >= 10e6) | |
| 10 uv_idle_stop(handle); | |
| 11 } | |
| 12 | |
| 13 int main() { | |
| 14 uv_idle_t idler; | |
| 15 | |
| 16 uv_idle_init(uv_default_loop(), &idler); | |
| 17 uv_idle_start(&idler, wait_for_a_while); | |
| 18 | |
| 19 printf("Idling...\n"); | |
| 20 uv_run(uv_default_loop(), UV_RUN_DEFAULT); | |
| 21 | |
| 22 uv_loop_close(uv_default_loop()); | |
| 23 return 0; | |
| 24 } |