summaryrefslogtreecommitdiffstats
path: root/net/base
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-10 16:35:47 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-10 16:35:47 +0000
commit85632fab9c8f30b4651f06fd75e1ba5881226e6c (patch)
tree45e5c31224f7b5951fbefb387da4f3fbf7acbd85 /net/base
parent99aae10b7b9cd4c1e08bb4e978c822483864e331 (diff)
downloadchromium_src-85632fab9c8f30b4651f06fd75e1ba5881226e6c.zip
chromium_src-85632fab9c8f30b4651f06fd75e1ba5881226e6c.tar.gz
chromium_src-85632fab9c8f30b4651f06fd75e1ba5881226e6c.tar.bz2
Switch to using TimeTicks for profiling and histograms
Avoid using wall clock time, which can be changed by the user, or impacted by Daylight Savings transitions etc. BUG=14193 r=eroman Review URL: http://codereview.chromium.org/1253005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46821 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r--net/base/file_stream_posix.cc5
-rw-r--r--net/base/file_stream_win.cc5
2 files changed, 6 insertions, 4 deletions
diff --git a/net/base/file_stream_posix.cc b/net/base/file_stream_posix.cc
index 65c8e2b..735f2b8 100644
--- a/net/base/file_stream_posix.cc
+++ b/net/base/file_stream_posix.cc
@@ -223,11 +223,12 @@ FileStream::AsyncContext::~AsyncContext() {
// still running the IO task, or the completion callback is queued up on the
// MessageLoopForIO, but AsyncContext() got deleted before then.
const bool need_to_wait = !background_io_completed_.IsSignaled();
- base::Time start = base::Time::Now();
+ base::TimeTicks start = base::TimeTicks::Now();
RunAsynchronousCallback();
if (need_to_wait) {
// We want to see if we block the message loop for too long.
- UMA_HISTOGRAM_TIMES("AsyncIO.FileStreamClose", base::Time::Now() - start);
+ UMA_HISTOGRAM_TIMES("AsyncIO.FileStreamClose",
+ base::TimeTicks::Now() - start);
}
}
}
diff --git a/net/base/file_stream_win.cc b/net/base/file_stream_win.cc
index 1ad9a34..6a6db90 100644
--- a/net/base/file_stream_win.cc
+++ b/net/base/file_stream_win.cc
@@ -74,14 +74,15 @@ class FileStream::AsyncContext : public MessageLoopForIO::IOHandler {
FileStream::AsyncContext::~AsyncContext() {
is_closing_ = true;
bool waited = false;
- base::Time start = base::Time::Now();
+ base::TimeTicks start = base::TimeTicks::Now();
while (callback_) {
waited = true;
MessageLoopForIO::current()->WaitForIOCompletion(INFINITE, this);
}
if (waited) {
// We want to see if we block the message loop for too long.
- UMA_HISTOGRAM_TIMES("AsyncIO.FileStreamClose", base::Time::Now() - start);
+ UMA_HISTOGRAM_TIMES("AsyncIO.FileStreamClose",
+ base::TimeTicks::Now() - start);
}
}