diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2022-03-21 03:37:29 +0100 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2022-03-21 03:38:18 +0100 |
commit | ec8a825b0e56c692c4879db10c6b25cd26bb42e4 (patch) | |
tree | a08ab989b42aa01933410b8bf54ddfb8243151f7 /src/include | |
parent | e96a9eb00942666fceb2a3658ee7b6d2784a098c (diff) | |
download | gnunet-ec8a825b0e56c692c4879db10c6b25cd26bb42e4.tar.gz gnunet-ec8a825b0e56c692c4879db10c6b25cd26bb42e4.zip |
add new approximate time cmp function
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_time_lib.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h index 96413c3cc..55af62b72 100644 --- a/src/include/gnunet_time_lib.h +++ b/src/include/gnunet_time_lib.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2001-2013 GNUnet e.V. | 3 | Copyright (C) 2001-2022 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
@@ -517,6 +517,21 @@ GNUNET_TIME_absolute_get_remaining (struct GNUNET_TIME_Absolute future); | |||
517 | 517 | ||
518 | 518 | ||
519 | /** | 519 | /** |
520 | * Test if @a a1 and @a a2 are equal within a margin of | ||
521 | * error of @a t. | ||
522 | * | ||
523 | * @param a1 time to compare | ||
524 | * @param a2 time to compare | ||
525 | * @param t tolerance to apply | ||
526 | * @return true if "|a1-a2|<=t" holds. | ||
527 | */ | ||
528 | bool | ||
529 | GNUNET_TIME_absolute_approx_eq (struct GNUNET_TIME_Absolute a1, | ||
530 | struct GNUNET_TIME_Absolute a2, | ||
531 | struct GNUNET_TIME_Relative t); | ||
532 | |||
533 | |||
534 | /** | ||
520 | * Calculate the estimate time of arrival/completion | 535 | * Calculate the estimate time of arrival/completion |
521 | * for an operation. | 536 | * for an operation. |
522 | * | 537 | * |