summaryrefslogtreecommitdiff
path: root/src/time.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-12-01 09:21:34 +0000
committerVincent Sanders <vince@kyllikki.org>2014-12-01 09:22:16 +0000
commit228710c55bc4e8f69ad56ad981b25a0c4ce41a4c (patch)
tree721e58e1a4723e228e22b5a67a8f451258c2fe88 /src/time.c
parentb6e898b7518777b41d9d82dd3e861a64016cbe0a (diff)
downloadlibnsutils-228710c55bc4e8f69ad56ad981b25a0c4ce41a4c.tar.gz
libnsutils-228710c55bc4e8f69ad56ad981b25a0c4ce41a4c.tar.bz2
do not report time in future if time did not move forwards.
Diffstat (limited to 'src/time.c')
-rw-r--r--src/time.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/time.c b/src/time.c
index 10e2705..94139c3 100644
--- a/src/time.c
+++ b/src/time.c
@@ -87,12 +87,10 @@ nsuerror nsu_getmonotonic_ms(uint64_t *current_out)
#endif
/* ensure time never goes backwards */
- if (current > prev) {
+ if (current >= prev) {
*current_out = current;
prev = current;
} else {
- /** \todo is 1ms really correct or can we calculate a delta going forwards? */
- prev += 1;
*current_out = prev;
}
return NSUERROR_OK;