Rhythm & Biology

Engineering, Science, et al.

2011-08-09から1日間の記事一覧

libeventでタイマー処理をする

libeventでタイマー処理をする方法について書きます。 まずは3秒後に指定の関数を呼ぶコードです。 #include <stdio.h> #include <sys/time.h> #include <event.h> void say_hello(int fd, short event, void *arg) { printf("Hello\n"); } int main(int argc, const char* argv[]) { struc</event.h></sys/time.h></stdio.h>…