Index: webrtc/base/logging.cc |
diff --git a/webrtc/base/logging.cc b/webrtc/base/logging.cc |
index 60603624a5e1dfacf4784fa849dd9d235c18d4ef..c951e156d8dc3e3da81af108c13630b198851a52 100644 |
--- a/webrtc/base/logging.cc |
+++ b/webrtc/base/logging.cc |
@@ -124,7 +124,9 @@ LogMessage::LogMessage(const char* file, |
const char* module) |
: severity_(sev), tag_(kLibjingle) { |
if (timestamp_) { |
- int64_t time = TimeSince(LogStartTime()); |
+ // Use SystemTimeMillis so that even if tests use fake clocks, the timestamp |
+ // in log messages represents the real system time. |
+ int64_t time = TimeDiff(SystemTimeMillis(), LogStartTime()); |
// Also ensure WallClockStartTime is initialized, so that it matches |
// LogStartTime. |
WallClockStartTime(); |
@@ -210,7 +212,7 @@ LogMessage::~LogMessage() { |
} |
int64_t LogMessage::LogStartTime() { |
- static const int64_t g_start = TimeMillis(); |
+ static const int64_t g_start = SystemTimeMillis(); |
return g_start; |
} |