summaryrefslogtreecommitdiff
path: root/mg_tools.c
diff options
context:
space:
mode:
Diffstat (limited to 'mg_tools.c')
-rw-r--r--mg_tools.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/mg_tools.c b/mg_tools.c
index 5d439db..529b931 100644
--- a/mg_tools.c
+++ b/mg_tools.c
@@ -12,6 +12,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <syslog.h>
+#include <sys/time.h>
+#include <time.h>
#include "mg_tools.h"
@@ -226,3 +228,13 @@ bool mkdir_p(const char *s) {
free(sc);
return true;
}
+
+void
+mgTimestamp(const char *s) {
+ char *buf;
+ struct timeval tv;
+ gettimeofday(&tv,0);
+ msprintf(&buf,"%s:%ld %ld ",s,tv.tv_sec,tv.tv_usec);
+ mgDebug(5,buf);
+ free(buf);
+}