Monitor time patch from Masahide NAKAMURA
diff --git a/lib/utils.c b/lib/utils.c
index df8795a..5954502 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -27,6 +27,9 @@
#include <resolv.h>
#include <asm/types.h>
#include <linux/pkt_sched.h>
+#include <time.h>
+#include <sys/time.h>
+
#include "utils.h"
@@ -557,3 +560,17 @@
memset(buf+cnt, 0, blen-cnt);
return buf;
}
+
+int print_timestamp(FILE *fp)
+{
+ struct timeval tv;
+ char *tstr;
+
+ memset(&tv, 0, sizeof(tv));
+ gettimeofday(&tv, NULL);
+
+ tstr = asctime(localtime(&tv.tv_sec));
+ tstr[strlen(tstr)-1] = 0;
+ fprintf(fp, "Timestamp: %s %lu usec\n", tstr, tv.tv_usec);
+ return 0;
+}