summaryrefslogtreecommitdiff
path: root/src/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/time.c')
-rw-r--r--src/time.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/time.c b/src/time.c
index c0a5dff..2b83f3f 100644
--- a/src/time.c
+++ b/src/time.c
@@ -14,12 +14,19 @@
#include <stdint.h>
#include <stdlib.h>
-#include <stdbool.h>
-#include <string.h>
+#include <sys/time.h>
#include "nsutils/time.h"
-nserror nsu_nsu_getmonotonic_ms(uint64_t *current)
+/* exported interface documented in nsutils/time.h */
+nsuerror nsu_nsu_getmonotonic_ms(uint64_t *current)
{
- return NSERROR_NOT_IMPLEMENTED;
+ /** \todo Implement this properly! */
+ struct timeval tv;
+
+ gettimeofday(&tv, NULL);
+
+ *current = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
+
+ return NSUERROR_OK;
}