Lines Matching refs:earlier
144 bool TimeIsBetween(uint32_t earlier, uint32_t middle, uint32_t later) { in TimeIsBetween() argument
145 if (earlier <= later) { in TimeIsBetween()
146 return ((earlier <= middle) && (middle <= later)); in TimeIsBetween()
148 return !((later < middle) && (middle < earlier)); in TimeIsBetween()
152 bool TimeIsLaterOrEqual(uint32_t earlier, uint32_t later) { in TimeIsLaterOrEqual() argument
154 int32_t diff = later - earlier; in TimeIsLaterOrEqual()
157 const bool later_or_equal = TimeIsBetween(earlier, later, earlier + HALF); in TimeIsLaterOrEqual()
162 bool TimeIsLater(uint32_t earlier, uint32_t later) { in TimeIsLater() argument
164 int32_t diff = later - earlier; in TimeIsLater()
167 const bool earlier_or_equal = TimeIsBetween(later, earlier, later + HALF); in TimeIsLater()
172 int32_t TimeDiff(uint32_t later, uint32_t earlier) { in TimeDiff() argument
174 return later - earlier; in TimeDiff()
176 const bool later_or_equal = TimeIsBetween(earlier, later, earlier + HALF); in TimeDiff()
178 if (earlier <= later) { in TimeDiff()
179 return static_cast<long>(later - earlier); in TimeDiff()
181 return static_cast<long>(later + (UINT32_MAX - earlier) + 1); in TimeDiff()
184 if (later <= earlier) { in TimeDiff()
185 return -static_cast<long>(earlier - later); in TimeDiff()
187 return -static_cast<long>(earlier + (UINT32_MAX - later) + 1); in TimeDiff()