summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/nsutils/time.h10
-rw-r--r--src/time.c4
2 files changed, 9 insertions, 5 deletions
diff --git a/include/nsutils/time.h b/include/nsutils/time.h
index 93a4c1d..aa39d94 100644
--- a/include/nsutils/time.h
+++ b/include/nsutils/time.h
@@ -18,10 +18,14 @@
#include <nsutils/errors.h>
/**
- * Get a monotonically incrementing number of milliseconds.
+ * Get a monotonically incriminating number of milliseconds.
*
- * Obtain a count of elapsed time in milliseconds. Unlike gettimeofday this
- * will continue linearly across time setting and not go backwards,
+ * Obtain a count of elapsed time in milliseconds from an arbitrary point in
+ * time. Unlike gettimeofday this will continue linearly across time setting
+ * and not go backwards.
+ *
+ * \note The read value will always increment by at least 1 on each call meaning
+ * times less than 1ms cannot be differentiated.
*
* \param current The current value of the counter.
* \return NSERROR_OK on success else error code.
diff --git a/src/time.c b/src/time.c
index 5ea1d3f..736c982 100644
--- a/src/time.c
+++ b/src/time.c
@@ -69,8 +69,8 @@ nsuerror nsu_getmonotonic_ms(uint64_t *current_out)
*current_out = current;
prev = current;
} else {
- /** \todo is 10ms really correct or can we calculate a delta going forwards? */
- prev += 10;
+ /** \todo is 1ms really correct or can we calculate a delta going forwards? */
+ prev += 1;
*current_out = prev;
}
return NSUERROR_OK;