X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=blobdiff_plain;f=src%2Ftest%2Ftimer%2Fiotest.c;h=17a91ecff13017a4967057330e57b421f8586c61;hp=7ce2d44e6acc872b4ef0137b53b0840b06741274;hb=f83bd22fe2dcb3ca0ddb9321944ee0b9c9b61ea6;hpb=6b235c4b3e0ff537bff312c5f18104e657b02883 diff --git a/src/test/timer/iotest.c b/src/test/timer/iotest.c index 7ce2d44..17a91ec 100644 --- a/src/test/timer/iotest.c +++ b/src/test/timer/iotest.c @@ -26,7 +26,7 @@ static IOHANDLER_LOG_BACKEND(io_log); static struct timeval test_clock1, test_clock2; static int timercount; -static void add_timer(int ms) { +void add_timer(int ms) { struct timeval timeout; gettimeofday(&timeout, NULL); timeout.tv_usec += (ms % 1000) * 1000; @@ -45,7 +45,8 @@ int main(int argc, char *argv[]) { gettimeofday(&test_clock1, NULL); gettimeofday(&test_clock2, NULL); - add_timer(TEST_DURATION); + //add_timer(TEST_DURATION); + iohandler_constant_timer(TEST_DURATION, io_callback); timercount = 0; printf("[timer 0] %ld.%ld\n", test_clock1.tv_sec, test_clock1.tv_usec); @@ -61,7 +62,7 @@ static IOHANDLER_CALLBACK(io_callback) { double diff2; switch(event->type) { case IOEVENT_TIMEOUT: - add_timer(TEST_DURATION); + //add_timer(TEST_DURATION); timercount++; gettimeofday(&curr_time, NULL); diff1 = (curr_time.tv_sec - test_clock1.tv_sec) * 1000 + ((curr_time.tv_usec - test_clock1.tv_usec) / 1000);