Don't use SystemTimeNanos() for current wallclock time on WINUWP
SystemTimeNanos() will soon be replaced with another implementation
when built with Chromium. This will break the assumption of
SystemTimeNanos() being relative to the NTP epoch. To avoid breaking
any UWP apps, call the TimeHelper::Ticks() function directly, which
is synchronized with the NTP epoch during initialization.
Bug: chromium:516700
Change-Id: I4e50cb3f88d06e1385e73b1a9ded52956501dc1f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208520
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33324}
diff --git a/rtc_base/time_utils.h b/rtc_base/time_utils.h
index ff22a61..de3c58c 100644
--- a/rtc_base/time_utils.h
+++ b/rtc_base/time_utils.h
@@ -62,6 +62,12 @@
// Synchronizes the current clock based upon an NTP server's epoch in
// milliseconds.
void SyncWithNtp(int64_t time_from_ntp_server_ms);
+
+// Returns the current time in nanoseconds. The clock is synchonized with the
+// system wall clock time upon instatiation. It may also be synchronized using
+// the SyncWithNtp() function above. Please note that the clock will most likely
+// drift away from the system wall clock time as time goes by.
+int64_t WinUwpSystemTimeNanos();
#endif // defined(WINUWP)
// Returns the actual system time, even if a clock is set for testing.