diff options
Diffstat (limited to 'csrc/smith.c')
-rw-r--r-- | csrc/smith.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/csrc/smith.c b/csrc/smith.c index 5ac1e73..3643abd 100644 --- a/csrc/smith.c +++ b/csrc/smith.c @@ -8,6 +8,8 @@ #include "smith.h" #include <sys/time.h> +#include <stdio.h> +#include <stdlib.h> char * mr_smith() @@ -15,13 +17,16 @@ mr_smith() return ("---SMITH_V0.0.0---"); } -long +char* get_timestamp() { struct timeval tv; long ct; + char * buffer; + buffer = (char*)malloc(30); gettimeofday(&tv, NULL); ct = ((tv.tv_sec * 1000) + (tv.tv_usec / 1000)); - return (ct); + sprintf(buffer, "%ld", ct); + return buffer; } |