Index: base/time_posix.cc |
diff --git a/base/time_posix.cc b/base/time_posix.cc |
index af7ee250e053c7e77508ff2690ac027edbdb1e6e..60771af9bc63a324901dd0603cb22455eeffed77 100644 |
--- a/base/time_posix.cc |
+++ b/base/time_posix.cc |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -190,4 +190,12 @@ struct timespec TimeDelta::ToTimeSpec() const { |
return result; |
} |
+struct timeval Time::ToTimeVal() const { |
+ struct timeval result; |
+ int64 us = us_ - kTimeTToMicrosecondsOffset; |
+ result.tv_sec = us / Time::kMicrosecondsPerSecond; |
+ result.tv_usec = us % Time::kMicrosecondsPerSecond; |
+ return result; |
+} |
+ |
} // namespace base |