[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: introduce new TIME helper functions
From: |
gnunet |
Subject: |
[gnunet] branch master updated: introduce new TIME helper functions |
Date: |
Fri, 23 Jul 2021 20:14:00 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new be8bca817 introduce new TIME helper functions
be8bca817 is described below
commit be8bca81797f31db878a1ecc33659fe931b5b7c0
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Jul 23 20:10:45 2021 +0200
introduce new TIME helper functions
---
src/include/gnunet_time_lib.h | 9 +++++++++
src/util/time.c | 7 +++++++
2 files changed, 16 insertions(+)
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
@@ -557,6 +557,15 @@ bool
GNUNET_TIME_relative_is_forever (struct GNUNET_TIME_Relative rel);
+/**
+ * Test if @a rel is zero.
+ *
+ * @return true if it is.
+ */
+bool
+GNUNET_TIME_relative_is_zero (struct GNUNET_TIME_Relative rel);
+
+
/**
* Convert seconds after the UNIX epoch to absolute time.
*
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)
}
+bool
+GNUNET_TIME_relative_is_zero (struct GNUNET_TIME_Relative rel)
+{
+ return rel.rel_value_us == 0;
+}
+
+
struct GNUNET_TIME_Absolute
GNUNET_TIME_absolute_from_ms (uint64_t ms_after_epoch)
{
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.