aboutsummaryrefslogtreecommitdiff
path: root/src/util/time.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-10-08 16:12:48 +0000
committerChristian Grothoff <christian@grothoff.org>2015-10-08 16:12:48 +0000
commitc95cd7a0899c5da94986c27df756e6555c5bd895 (patch)
treec746ffe8cf6af162ac2ef0fe9f72ffe36bf075ac /src/util/time.c
parent404e6ca13698dd6ceb92b71494989fb5d11ac403 (diff)
downloadgnunet-c95cd7a0899c5da94986c27df756e6555c5bd895.tar.gz
gnunet-c95cd7a0899c5da94986c27df756e6555c5bd895.zip
-make time API more intutitive
Diffstat (limited to 'src/util/time.c')
-rw-r--r--src/util/time.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/util/time.c b/src/util/time.c
index baf7ee67d..ba849e265 100644
--- a/src/util/time.c
+++ b/src/util/time.c
@@ -309,7 +309,7 @@ GNUNET_TIME_absolute_get_difference (struct GNUNET_TIME_Absolute start,
309 * Get the duration of an operation as the 309 * Get the duration of an operation as the
310 * difference of the current time and the given start time "whence". 310 * difference of the current time and the given start time "whence".
311 * 311 *
312 * @return aborts if whence==FOREVER, 0 if whence > now, otherwise now-whence. 312 * @return 0 if whence > now, otherwise now-whence.
313 */ 313 */
314struct GNUNET_TIME_Relative 314struct GNUNET_TIME_Relative
315GNUNET_TIME_absolute_get_duration (struct GNUNET_TIME_Absolute whence) 315GNUNET_TIME_absolute_get_duration (struct GNUNET_TIME_Absolute whence)
@@ -318,7 +318,6 @@ GNUNET_TIME_absolute_get_duration (struct GNUNET_TIME_Absolute whence)
318 struct GNUNET_TIME_Relative ret; 318 struct GNUNET_TIME_Relative ret;
319 319
320 now = GNUNET_TIME_absolute_get (); 320 now = GNUNET_TIME_absolute_get ();
321 GNUNET_assert (whence.abs_value_us != UINT64_MAX);
322 if (whence.abs_value_us > now.abs_value_us) 321 if (whence.abs_value_us > now.abs_value_us)
323 return GNUNET_TIME_UNIT_ZERO; 322 return GNUNET_TIME_UNIT_ZERO;
324 ret.rel_value_us = now.abs_value_us - whence.abs_value_us; 323 ret.rel_value_us = now.abs_value_us - whence.abs_value_us;