diff options
Diffstat (limited to 'mg_tools.c')
| -rw-r--r-- | mg_tools.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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); +} |
