diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-10-08 16:12:48 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-10-08 16:12:48 +0000 |
commit | c95cd7a0899c5da94986c27df756e6555c5bd895 (patch) | |
tree | c746ffe8cf6af162ac2ef0fe9f72ffe36bf075ac | |
parent | 404e6ca13698dd6ceb92b71494989fb5d11ac403 (diff) |
-make time API more intutitive
-rw-r--r-- | src/include/gnunet_time_lib.h | 2 | ||||
-rw-r--r-- | src/util/time.c | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h index b4b58f40cf..c4e771eebc 100644 --- a/src/include/gnunet_time_lib.h +++ b/src/include/gnunet_time_lib.h @@ -349,7 +349,7 @@ GNUNET_TIME_absolute_get_difference (struct GNUNET_TIME_Absolute start, * difference of the current time and the given start time "hence". * * @param whence some absolute time, typically in the past - * @return aborts if hence==FOREVER, 0 if hence > now, otherwise now-hence. + * @return 0 if hence > now, otherwise now-hence. */ struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration (struct GNUNET_TIME_Absolute whence); diff --git a/src/util/time.c b/src/util/time.c index baf7ee67db..ba849e2659 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, * Get the duration of an operation as the * difference of the current time and the given start time "whence". * - * @return aborts if whence==FOREVER, 0 if whence > now, otherwise now-whence. + * @return 0 if whence > now, otherwise now-whence. */ struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration (struct GNUNET_TIME_Absolute whence) @@ -318,7 +318,6 @@ GNUNET_TIME_absolute_get_duration (struct GNUNET_TIME_Absolute whence) struct GNUNET_TIME_Relative ret; now = GNUNET_TIME_absolute_get (); - GNUNET_assert (whence.abs_value_us != UINT64_MAX); if (whence.abs_value_us > now.abs_value_us) return GNUNET_TIME_UNIT_ZERO; ret.rel_value_us = now.abs_value_us - whence.abs_value_us; |