iperf3-tls/src/t_timer.c

28 lines
411 B
C
Raw Normal View History

2009-02-24 06:22:58 +00:00
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include "timer.h"
int main(int argc, char **argv)
{
struct timer *tp;
tp = new_timer(3, 0);
2009-02-24 06:22:58 +00:00
sleep(2);
2009-02-24 06:22:58 +00:00
if(tp->expired(tp)) {
printf("timer should not have expired\n");
exit(-1);
}
sleep(1);
2009-02-24 06:22:58 +00:00
if(!tp->expired(tp)) {
printf("timer should have expired\n");
exit(-2);
}
exit(0);
}