diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_time_lib.h | 9 | ||||
-rw-r--r-- | src/util/time.c | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h index bddf5c6bf..ff602194c 100644 --- a/src/include/gnunet_time_lib.h +++ b/src/include/gnunet_time_lib.h | |||
@@ -558,6 +558,15 @@ GNUNET_TIME_relative_is_forever (struct GNUNET_TIME_Relative rel); | |||
558 | 558 | ||
559 | 559 | ||
560 | /** | 560 | /** |
561 | * Test if @a rel is zero. | ||
562 | * | ||
563 | * @return true if it is. | ||
564 | */ | ||
565 | bool | ||
566 | GNUNET_TIME_relative_is_zero (struct GNUNET_TIME_Relative rel); | ||
567 | |||
568 | |||
569 | /** | ||
561 | * Convert seconds after the UNIX epoch to absolute time. | 570 | * Convert seconds after the UNIX epoch to absolute time. |
562 | * | 571 | * |
563 | * @param s_after_epoch seconds after epoch to convert | 572 | * @param s_after_epoch seconds after epoch to convert |
diff --git a/src/util/time.c b/src/util/time.c index 15a4160e2..3ea5a1ea1 100644 --- a/src/util/time.c +++ b/src/util/time.c | |||
@@ -484,6 +484,13 @@ GNUNET_TIME_relative_is_forever (struct GNUNET_TIME_Relative rel) | |||
484 | } | 484 | } |
485 | 485 | ||
486 | 486 | ||
487 | bool | ||
488 | GNUNET_TIME_relative_is_zero (struct GNUNET_TIME_Relative rel) | ||
489 | { | ||
490 | return rel.rel_value_us == 0; | ||
491 | } | ||
492 | |||
493 | |||
487 | struct GNUNET_TIME_Absolute | 494 | struct GNUNET_TIME_Absolute |
488 | GNUNET_TIME_absolute_from_ms (uint64_t ms_after_epoch) | 495 | GNUNET_TIME_absolute_from_ms (uint64_t ms_after_epoch) |
489 | { | 496 | { |