3 * cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent
14 #include <sys/queue.h>
18 #ifdef HAVE_SYS_TIME_H
33 timeout_cb(int fd
, short event
, void *arg
)
36 struct event
*timeout
= arg
;
37 int newtime
= time(NULL
);
39 printf("%s: called at %d: %d\n", __func__
, newtime
,
43 evutil_timerclear(&tv
);
45 event_add(timeout
, &tv
);
49 main (int argc
, char **argv
)
54 /* Initalize the event library */
57 /* Initalize one event */
58 evtimer_set(&timeout
, timeout_cb
, &timeout
);
60 evutil_timerclear(&tv
);
62 event_add(&timeout
, &tv
);
64 lasttime
= time(NULL
);