Lines Matching refs:time_internal
78 using time_internal::kTicksPerNanosecond;
79 using time_internal::kTicksPerSecond;
127 int64_t rep_hi = time_internal::GetRepHi(d); in MakeU128Ticks()
128 uint32_t rep_lo = time_internal::GetRepLo(d); in MakeU128Ticks()
160 return time_internal::MakeDuration(kint64min); in MakeDurationFromU128()
177 return time_internal::MakeDuration(rep_hi, rep_lo); in MakeDurationFromU128()
209 *d = time_internal::MakeDuration(c, time_internal::GetRepLo(*d)); in SafeAddRepHi()
237 const bool is_neg = (time_internal::GetRepHi(d) < 0) != (r < 0); in ScaleFixed()
246 double hi_doub = op(time_internal::GetRepHi(d), r); in ScaleDouble()
247 double lo_doub = op(time_internal::GetRepLo(d), r); in ScaleDouble()
264 int64_t hi64 = time_internal::GetRepHi(ans); in ScaleDouble()
266 hi64 = time_internal::GetRepHi(ans); in ScaleDouble()
269 return time_internal::MakeDuration(hi64, lo64); in ScaleDouble()
278 if (time_internal::IsInfiniteDuration(num) || in IDivFastPath()
279 time_internal::IsInfiniteDuration(den)) in IDivFastPath()
282 int64_t num_hi = time_internal::GetRepHi(num); in IDivFastPath()
283 uint32_t num_lo = time_internal::GetRepLo(num); in IDivFastPath()
284 int64_t den_hi = time_internal::GetRepHi(den); in IDivFastPath()
285 uint32_t den_lo = time_internal::GetRepLo(den); in IDivFastPath()
291 *rem = time_internal::MakeDuration(0, num_lo % den_lo); in IDivFastPath()
298 *rem = time_internal::MakeDuration(0, num_lo % den_lo); in IDivFastPath()
305 *rem = time_internal::MakeDuration(0, num_lo % den_lo); in IDivFastPath()
312 *rem = time_internal::MakeDuration(0, num_lo % den_lo); in IDivFastPath()
320 *rem = time_internal::MakeDuration(0, num_lo); in IDivFastPath()
324 *rem = time_internal::MakeDuration(num_hi % den_hi, num_lo); in IDivFastPath()
340 *rem = time_internal::MakeDuration(rem_sec, num_lo); in IDivFastPath()
349 namespace time_internal { namespace
366 if (time_internal::IsInfiniteDuration(num) || den == ZeroDuration()) { in IDivDuration()
370 if (time_internal::IsInfiniteDuration(den)) { in IDivDuration()
405 if (time_internal::IsInfiniteDuration(*this)) return *this; in operator +=()
406 if (time_internal::IsInfiniteDuration(rhs)) return *this = rhs; in operator +=()
422 if (time_internal::IsInfiniteDuration(*this)) return *this; in operator -=()
423 if (time_internal::IsInfiniteDuration(rhs)) { in operator -=()
445 if (time_internal::IsInfiniteDuration(*this)) { in operator *=()
453 if (time_internal::IsInfiniteDuration(*this) || !IsFinite(r)) { in operator *=()
461 if (time_internal::IsInfiniteDuration(*this) || r == 0) { in operator /=()
469 if (time_internal::IsInfiniteDuration(*this) || !IsValidDivisor(r)) { in operator /=()
477 time_internal::IDivDuration(false, *this, rhs, this); in operator %=()
483 if (time_internal::IsInfiniteDuration(num) || den == ZeroDuration()) { in FDivDuration()
488 if (time_internal::IsInfiniteDuration(den)) return 0.0; in FDivDuration()
491 static_cast<double>(time_internal::GetRepHi(num)) * kTicksPerSecond + in FDivDuration()
492 time_internal::GetRepLo(num); in FDivDuration()
494 static_cast<double>(time_internal::GetRepHi(den)) * kTicksPerSecond + in FDivDuration()
495 time_internal::GetRepLo(den); in FDivDuration()
524 return time_internal::MakeDuration(ts.tv_sec, ticks); in DurationFromTimespec()
532 return time_internal::MakeDuration(tv.tv_sec, ticks); in DurationFromTimeval()
542 if (time_internal::GetRepHi(d) >= 0 && in ToInt64Nanoseconds()
543 time_internal::GetRepHi(d) >> 33 == 0) { in ToInt64Nanoseconds()
544 return (time_internal::GetRepHi(d) * 1000 * 1000 * 1000) + in ToInt64Nanoseconds()
545 (time_internal::GetRepLo(d) / kTicksPerNanosecond); in ToInt64Nanoseconds()
550 if (time_internal::GetRepHi(d) >= 0 && in ToInt64Microseconds()
551 time_internal::GetRepHi(d) >> 43 == 0) { in ToInt64Microseconds()
552 return (time_internal::GetRepHi(d) * 1000 * 1000) + in ToInt64Microseconds()
553 (time_internal::GetRepLo(d) / (kTicksPerNanosecond * 1000)); in ToInt64Microseconds()
558 if (time_internal::GetRepHi(d) >= 0 && in ToInt64Milliseconds()
559 time_internal::GetRepHi(d) >> 53 == 0) { in ToInt64Milliseconds()
560 return (time_internal::GetRepHi(d) * 1000) + in ToInt64Milliseconds()
561 (time_internal::GetRepLo(d) / (kTicksPerNanosecond * 1000 * 1000)); in ToInt64Milliseconds()
566 int64_t hi = time_internal::GetRepHi(d); in ToInt64Seconds()
567 if (time_internal::IsInfiniteDuration(d)) return hi; in ToInt64Seconds()
568 if (hi < 0 && time_internal::GetRepLo(d) != 0) ++hi; in ToInt64Seconds()
572 int64_t hi = time_internal::GetRepHi(d); in ToInt64Minutes()
573 if (time_internal::IsInfiniteDuration(d)) return hi; in ToInt64Minutes()
574 if (hi < 0 && time_internal::GetRepLo(d) != 0) ++hi; in ToInt64Minutes()
578 int64_t hi = time_internal::GetRepHi(d); in ToInt64Hours()
579 if (time_internal::IsInfiniteDuration(d)) return hi; in ToInt64Hours()
580 if (hi < 0 && time_internal::GetRepLo(d) != 0) ++hi; in ToInt64Hours()
605 if (!time_internal::IsInfiniteDuration(d)) { in ToTimespec()
606 int64_t rep_hi = time_internal::GetRepHi(d); in ToTimespec()
607 uint32_t rep_lo = time_internal::GetRepLo(d); in ToTimespec()
661 return time_internal::ToChronoDuration<std::chrono::nanoseconds>(d); in ToChronoNanoseconds()
664 return time_internal::ToChronoDuration<std::chrono::microseconds>(d); in ToChronoMicroseconds()
667 return time_internal::ToChronoDuration<std::chrono::milliseconds>(d); in ToChronoMilliseconds()
670 return time_internal::ToChronoDuration<std::chrono::seconds>(d); in ToChronoSeconds()
673 return time_internal::ToChronoDuration<std::chrono::minutes>(d); in ToChronoMinutes()
676 return time_internal::ToChronoDuration<std::chrono::hours>(d); in ToChronoHours()