diff options
Diffstat (limited to 'src/include/gnunet_time_lib.h')
-rw-r--r-- | src/include/gnunet_time_lib.h | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h index 450417730..298f3284a 100644 --- a/src/include/gnunet_time_lib.h +++ b/src/include/gnunet_time_lib.h | |||
@@ -1,10 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 Christian Grothoff (and other contributing authors) | 3 | (C) 2001-2013 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
7 | by the Free Software Foundation; either version 2, or (at your | 7 | by the Free Software Foundation; either version 3, or (at your |
8 | option) any later version. | 8 | option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
@@ -39,18 +39,18 @@ extern "C" | |||
39 | #include "gnunet_common.h" | 39 | #include "gnunet_common.h" |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * Time for absolute times used by GNUnet, in milliseconds. | 42 | * Time for absolute times used by GNUnet, in microseconds. |
43 | */ | 43 | */ |
44 | struct GNUNET_TIME_Absolute | 44 | struct GNUNET_TIME_Absolute |
45 | { | 45 | { |
46 | /** | 46 | /** |
47 | * The actual value. | 47 | * The actual value. |
48 | */ | 48 | */ |
49 | uint64_t abs_value; | 49 | uint64_t abs_value_us; |
50 | }; | 50 | }; |
51 | 51 | ||
52 | /** | 52 | /** |
53 | * Time for relative time used by GNUnet, in milliseconds. | 53 | * Time for relative time used by GNUnet, in microseconds. |
54 | * Always positive, so we can only refer to future time. | 54 | * Always positive, so we can only refer to future time. |
55 | */ | 55 | */ |
56 | struct GNUNET_TIME_Relative | 56 | struct GNUNET_TIME_Relative |
@@ -58,32 +58,32 @@ struct GNUNET_TIME_Relative | |||
58 | /** | 58 | /** |
59 | * The actual value. | 59 | * The actual value. |
60 | */ | 60 | */ |
61 | uint64_t rel_value; | 61 | uint64_t rel_value_us; |
62 | }; | 62 | }; |
63 | 63 | ||
64 | GNUNET_NETWORK_STRUCT_BEGIN | 64 | GNUNET_NETWORK_STRUCT_BEGIN |
65 | 65 | ||
66 | /** | 66 | /** |
67 | * Time for relative time used by GNUnet, in milliseconds and in network byte order. | 67 | * Time for relative time used by GNUnet, in microseconds and in network byte order. |
68 | */ | 68 | */ |
69 | struct GNUNET_TIME_RelativeNBO | 69 | struct GNUNET_TIME_RelativeNBO |
70 | { | 70 | { |
71 | /** | 71 | /** |
72 | * The actual value (in network byte order). | 72 | * The actual value (in network byte order). |
73 | */ | 73 | */ |
74 | uint64_t rel_value__ GNUNET_PACKED; | 74 | uint64_t rel_value_us__ GNUNET_PACKED; |
75 | }; | 75 | }; |
76 | 76 | ||
77 | 77 | ||
78 | /** | 78 | /** |
79 | * Time for absolute time used by GNUnet, in milliseconds and in network byte order. | 79 | * Time for absolute time used by GNUnet, in microseconds and in network byte order. |
80 | */ | 80 | */ |
81 | struct GNUNET_TIME_AbsoluteNBO | 81 | struct GNUNET_TIME_AbsoluteNBO |
82 | { | 82 | { |
83 | /** | 83 | /** |
84 | * The actual value (in network byte order). | 84 | * The actual value (in network byte order). |
85 | */ | 85 | */ |
86 | uint64_t abs_value__ GNUNET_PACKED; | 86 | uint64_t abs_value_us__ GNUNET_PACKED; |
87 | }; | 87 | }; |
88 | GNUNET_NETWORK_STRUCT_END | 88 | GNUNET_NETWORK_STRUCT_END |
89 | 89 | ||
@@ -98,9 +98,14 @@ GNUNET_NETWORK_STRUCT_END | |||
98 | #define GNUNET_TIME_UNIT_ZERO_ABS GNUNET_TIME_absolute_get_zero_() | 98 | #define GNUNET_TIME_UNIT_ZERO_ABS GNUNET_TIME_absolute_get_zero_() |
99 | 99 | ||
100 | /** | 100 | /** |
101 | * One millisecond, our basic time unit. | 101 | * One microsecond, our basic time unit. |
102 | */ | 102 | */ |
103 | #define GNUNET_TIME_UNIT_MILLISECONDS GNUNET_TIME_relative_get_unit_() | 103 | #define GNUNET_TIME_UNIT_MICROSECONDS GNUNET_TIME_relative_get_unit_() |
104 | |||
105 | /** | ||
106 | * One millisecond. | ||
107 | */ | ||
108 | #define GNUNET_TIME_UNIT_MILLISECONDS GNUNET_TIME_relative_get_millisecond_() | ||
104 | 109 | ||
105 | /** | 110 | /** |
106 | * One second. | 111 | * One second. |
@@ -181,13 +186,20 @@ GNUNET_TIME_absolute_get_zero_ (void); | |||
181 | 186 | ||
182 | 187 | ||
183 | /** | 188 | /** |
184 | * Return relative time of 1ms. | 189 | * Return relative time of 1 microsecond. |
185 | */ | 190 | */ |
186 | struct GNUNET_TIME_Relative | 191 | struct GNUNET_TIME_Relative |
187 | GNUNET_TIME_relative_get_unit_ (void); | 192 | GNUNET_TIME_relative_get_unit_ (void); |
188 | 193 | ||
189 | 194 | ||
190 | /** | 195 | /** |
196 | * Return relative time of 1ms. | ||
197 | */ | ||
198 | struct GNUNET_TIME_Relative | ||
199 | GNUNET_TIME_relative_get_millisecond_ (void); | ||
200 | |||
201 | |||
202 | /** | ||
191 | * Return relative time of 1s. | 203 | * Return relative time of 1s. |
192 | */ | 204 | */ |
193 | struct GNUNET_TIME_Relative | 205 | struct GNUNET_TIME_Relative |