/* * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/
int64_t time_ntp_us = time_us + ntp_offset_us;
RTC_DCHECK_GE(time_ntp_us, 0); // Time before year 1900 is unsupported.
// Convert seconds to uint32 through uint64 for a well-defined cast. // A wrap around, which will happen in 2036, is expected for NTP time.
uint32_t ntp_seconds = static_cast<uint64_t>(time_ntp_us / rtc::kNumMicrosecsPerSec);
// Scale fractions of the second to NTP resolution.
constexpr int64_t kNtpFractionsInSecond = 1LL << 32;
int64_t us_fractions = time_ntp_us % rtc::kNumMicrosecsPerSec;
uint32_t ntp_fractions =
us_fractions * kNtpFractionsInSecond / rtc::kNumMicrosecsPerSec;
return NtpTime(ntp_seconds, ntp_fractions);
}
} // namespace
class RealTimeClock : public Clock { public:
RealTimeClock() = default;
// TODO(bugs.webrtc.org(12102): It's desirable to let a single thread own // advancement of the clock. We could then replace this read-modify-write // operation with just a thread checker. But currently, that breaks a couple of // tests, in particular, RepeatingTaskTest.ClockIntegration and // CallStatsTest.LastProcessedRtt. void SimulatedClock::AdvanceTime(TimeDelta delta) {
time_us_.fetch_add(delta.us(), std::memory_order_relaxed);
}
} // namespace webrtc
Messung V0.5
¤ Dauer der Verarbeitung: 0.8 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.