Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <time.h>
- #include <uv.h>
- uv_loop_t *loop;
- uv_timer_t gc_req;
- uv_timer_t fake_job_req;
- void fake_job(uv_timer_t* timer, int status) {
- printf("%ld\n", (long int) time(NULL));
- sleep(2);
- }
- int main() {
- loop = uv_default_loop();
- // could actually be a TCP download or something
- uv_timer_init(loop, &fake_job_req);
- uv_timer_start(&fake_job_req, fake_job, 0, 5000);
- return uv_run(loop, UV_RUN_DEFAULT);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement