summaryrefslogtreecommitdiffstats
path: root/base/time_posix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/time_posix.cc')
-rw-r--r--base/time_posix.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/base/time_posix.cc b/base/time_posix.cc
index af7ee25..60771af 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