Lines Matching refs:time_internal
81 using time_internal::kTicksPerNanosecond;
82 using time_internal::kTicksPerSecond;
130 int64_t rep_hi = time_internal::GetRepHi(d); in MakeU128Ticks()
131 uint32_t rep_lo = time_internal::GetRepLo(d); in MakeU128Ticks()
163 return time_internal::MakeDuration(kint64min); in MakeDurationFromU128()
180 return time_internal::MakeDuration(rep_hi, rep_lo); in MakeDurationFromU128()
212 *d = time_internal::MakeDuration(c, time_internal::GetRepLo(*d)); in SafeAddRepHi()
240 const bool is_neg = (time_internal::GetRepHi(d) < 0) != (r < 0); in ScaleFixed()
249 double hi_doub = op(time_internal::GetRepHi(d), r); in ScaleDouble()
250 double lo_doub = op(time_internal::GetRepLo(d), r); in ScaleDouble()
267 int64_t hi64 = time_internal::GetRepHi(ans); in ScaleDouble()
269 hi64 = time_internal::GetRepHi(ans); in ScaleDouble()
272 return time_internal::MakeDuration(hi64, lo64); in ScaleDouble()
281 if (time_internal::IsInfiniteDuration(num) || in IDivFastPath()
282 time_internal::IsInfiniteDuration(den)) in IDivFastPath()
285 int64_t num_hi = time_internal::GetRepHi(num); in IDivFastPath()
286 uint32_t num_lo = time_internal::GetRepLo(num); in IDivFastPath()
287 int64_t den_hi = time_internal::GetRepHi(den); in IDivFastPath()
288 uint32_t den_lo = time_internal::GetRepLo(den); in IDivFastPath()
294 *rem = time_internal::MakeDuration(0, num_lo % den_lo); in IDivFastPath()
301 *rem = time_internal::MakeDuration(0, num_lo % den_lo); in IDivFastPath()
308 *rem = time_internal::MakeDuration(0, num_lo % den_lo); in IDivFastPath()
315 *rem = time_internal::MakeDuration(0, num_lo % den_lo); in IDivFastPath()
323 *rem = time_internal::MakeDuration(0, num_lo); in IDivFastPath()
327 *rem = time_internal::MakeDuration(num_hi % den_hi, num_lo); in IDivFastPath()
343 *rem = time_internal::MakeDuration(rem_sec, num_lo); in IDivFastPath()
352 namespace time_internal { namespace
369 if (time_internal::IsInfiniteDuration(num) || den == ZeroDuration()) { in IDivDuration()
373 if (time_internal::IsInfiniteDuration(den)) { in IDivDuration()
408 if (time_internal::IsInfiniteDuration(*this)) return *this; in operator +=()
409 if (time_internal::IsInfiniteDuration(rhs)) return *this = rhs; in operator +=()
425 if (time_internal::IsInfiniteDuration(*this)) return *this; in operator -=()
426 if (time_internal::IsInfiniteDuration(rhs)) { in operator -=()
448 if (time_internal::IsInfiniteDuration(*this)) { in operator *=()
456 if (time_internal::IsInfiniteDuration(*this) || !IsFinite(r)) { in operator *=()
464 if (time_internal::IsInfiniteDuration(*this) || r == 0) { in operator /=()
472 if (time_internal::IsInfiniteDuration(*this) || !IsValidDivisor(r)) { in operator /=()
480 time_internal::IDivDuration(false, *this, rhs, this); in operator %=()
486 if (time_internal::IsInfiniteDuration(num) || den == ZeroDuration()) { in FDivDuration()
491 if (time_internal::IsInfiniteDuration(den)) return 0.0; in FDivDuration()
494 static_cast<double>(time_internal::GetRepHi(num)) * kTicksPerSecond + in FDivDuration()
495 time_internal::GetRepLo(num); in FDivDuration()
497 static_cast<double>(time_internal::GetRepHi(den)) * kTicksPerSecond + in FDivDuration()
498 time_internal::GetRepLo(den); in FDivDuration()
527 return time_internal::MakeDuration(ts.tv_sec, ticks); in DurationFromTimespec()
535 return time_internal::MakeDuration(tv.tv_sec, ticks); in DurationFromTimeval()
545 if (time_internal::GetRepHi(d) >= 0 && in ToInt64Nanoseconds()
546 time_internal::GetRepHi(d) >> 33 == 0) { in ToInt64Nanoseconds()
547 return (time_internal::GetRepHi(d) * 1000 * 1000 * 1000) + in ToInt64Nanoseconds()
548 (time_internal::GetRepLo(d) / kTicksPerNanosecond); in ToInt64Nanoseconds()
553 if (time_internal::GetRepHi(d) >= 0 && in ToInt64Microseconds()
554 time_internal::GetRepHi(d) >> 43 == 0) { in ToInt64Microseconds()
555 return (time_internal::GetRepHi(d) * 1000 * 1000) + in ToInt64Microseconds()
556 (time_internal::GetRepLo(d) / (kTicksPerNanosecond * 1000)); in ToInt64Microseconds()
561 if (time_internal::GetRepHi(d) >= 0 && in ToInt64Milliseconds()
562 time_internal::GetRepHi(d) >> 53 == 0) { in ToInt64Milliseconds()
563 return (time_internal::GetRepHi(d) * 1000) + in ToInt64Milliseconds()
564 (time_internal::GetRepLo(d) / (kTicksPerNanosecond * 1000 * 1000)); in ToInt64Milliseconds()
569 int64_t hi = time_internal::GetRepHi(d); in ToInt64Seconds()
570 if (time_internal::IsInfiniteDuration(d)) return hi; in ToInt64Seconds()
571 if (hi < 0 && time_internal::GetRepLo(d) != 0) ++hi; in ToInt64Seconds()
575 int64_t hi = time_internal::GetRepHi(d); in ToInt64Minutes()
576 if (time_internal::IsInfiniteDuration(d)) return hi; in ToInt64Minutes()
577 if (hi < 0 && time_internal::GetRepLo(d) != 0) ++hi; in ToInt64Minutes()
581 int64_t hi = time_internal::GetRepHi(d); in ToInt64Hours()
582 if (time_internal::IsInfiniteDuration(d)) return hi; in ToInt64Hours()
583 if (hi < 0 && time_internal::GetRepLo(d) != 0) ++hi; in ToInt64Hours()
608 if (!time_internal::IsInfiniteDuration(d)) { in ToTimespec()
609 int64_t rep_hi = time_internal::GetRepHi(d); in ToTimespec()
610 uint32_t rep_lo = time_internal::GetRepLo(d); in ToTimespec()
664 return time_internal::ToChronoDuration<std::chrono::nanoseconds>(d); in ToChronoNanoseconds()
667 return time_internal::ToChronoDuration<std::chrono::microseconds>(d); in ToChronoMicroseconds()
670 return time_internal::ToChronoDuration<std::chrono::milliseconds>(d); in ToChronoMilliseconds()
673 return time_internal::ToChronoDuration<std::chrono::seconds>(d); in ToChronoSeconds()
676 return time_internal::ToChronoDuration<std::chrono::minutes>(d); in ToChronoMinutes()
679 return time_internal::ToChronoDuration<std::chrono::hours>(d); in ToChronoHours()