diff options
author | t3sserakt <t3ss@posteo.de> | 2022-04-01 15:08:41 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2022-04-03 14:29:27 +0200 |
commit | 8f5b71e500a10790bf72d42de03e2db4971bf772 (patch) | |
tree | 10507356b5df0d2d0ce0b3b60a91dc070ce1001d /src/include/gnunet_time_lib.h | |
parent | 027177be3bae0c60d530b0b88ed375b082c94d81 (diff) | |
parent | e6a0ea8cf388a05856aaedbc5444f266ae47a7ef (diff) | |
download | gnunet-8f5b71e500a10790bf72d42de03e2db4971bf772.tar.gz gnunet-8f5b71e500a10790bf72d42de03e2db4971bf772.zip |
Merge branch 'master' of ssh://git.gnunet.org/gnunet
Diffstat (limited to 'src/include/gnunet_time_lib.h')
-rw-r--r-- | src/include/gnunet_time_lib.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h index 96413c3cc..d59eb984d 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 |
@@ -482,6 +482,18 @@ GNUNET_TIME_absolute_max (struct GNUNET_TIME_Absolute t1, | |||
482 | 482 | ||
483 | 483 | ||
484 | /** | 484 | /** |
485 | * Round down absolute time @a at to multiple of @a rt. | ||
486 | * | ||
487 | * @param at absolute time to round | ||
488 | * @param rt multiple to round to (non-zero) | ||
489 | * @return rounded time | ||
490 | */ | ||
491 | struct GNUNET_TIME_Absolute | ||
492 | GNUNET_TIME_absolute_round_down (struct GNUNET_TIME_Absolute at, | ||
493 | struct GNUNET_TIME_Relative rt); | ||
494 | |||
495 | |||
496 | /** | ||
485 | * Return the maximum of two timestamps. | 497 | * Return the maximum of two timestamps. |
486 | * | 498 | * |
487 | * @param t1 first timestamp | 499 | * @param t1 first timestamp |
@@ -517,6 +529,21 @@ GNUNET_TIME_absolute_get_remaining (struct GNUNET_TIME_Absolute future); | |||
517 | 529 | ||
518 | 530 | ||
519 | /** | 531 | /** |
532 | * Test if @a a1 and @a a2 are equal within a margin of | ||
533 | * error of @a t. | ||
534 | * | ||
535 | * @param a1 time to compare | ||
536 | * @param a2 time to compare | ||
537 | * @param t tolerance to apply | ||
538 | * @return true if "|a1-a2|<=t" holds. | ||
539 | */ | ||
540 | bool | ||
541 | GNUNET_TIME_absolute_approx_eq (struct GNUNET_TIME_Absolute a1, | ||
542 | struct GNUNET_TIME_Absolute a2, | ||
543 | struct GNUNET_TIME_Relative t); | ||
544 | |||
545 | |||
546 | /** | ||
520 | * Calculate the estimate time of arrival/completion | 547 | * Calculate the estimate time of arrival/completion |
521 | * for an operation. | 548 | * for an operation. |
522 | * | 549 | * |