3 * c++ -I/usr/local/include -o time-test time-test.cpp -L/usr/local/lib -levent
5 * Wed 2006-12-27 - Modified by Leandro Lucarella <llucarella@integratech.com.ar>
7 * Adapted to test the C++ inteface.
11 #include <sys/types.h>
27 eventxx::ctimer* ev[NEVENT];
28 eventxx::dispatcher d;
31 time_cb(int fd, short event, void *arg)
35 if (called < 10*NEVENT) {
36 for (int i = 0; i < 10; i++) {
37 eventxx::time tv(0, random() % 50000L);
38 int j = random() % NEVENT;
48 main (int argc, char **argv)
50 for (int i = 0; i < NEVENT; i++) {
51 /* Initalize one event */
52 ev[i] = new eventxx::ctimer(time_cb, NULL);
53 d.add(*ev[i], eventxx::time(0, random() % 50000L));
58 return (called < NEVENT);