diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-03 21:39:26 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-03 21:39:26 +0000 |
commit | c20210e6a0c40bce1781a42abf81b44ba627f2a9 (patch) | |
tree | e658b8111109145bc450603ac69cb0de3dd47eb2 /base/time.cc | |
parent | 601b54022e6232875c8b24501e425b450f071217 (diff) | |
download | chromium_src-c20210e6a0c40bce1781a42abf81b44ba627f2a9.zip chromium_src-c20210e6a0c40bce1781a42abf81b44ba627f2a9.tar.gz chromium_src-c20210e6a0c40bce1781a42abf81b44ba627f2a9.tar.bz2 |
- Added support for keeping track of load times.
For each document loaded we record the time the page was requested by the user
(or as close as we can get to that), the time the load process started, the time
the
document and it's dependent resources (scripts) have been loaded (before
onload())
and the time all the document's resources have been loaded.
We use this data for two things:
1) We histogram the deltas between the time marks
2) We expose the times to javascript running on the page which was loaded
Review URL: http://codereview.chromium.org/42527
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13116 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/time.cc')
-rw-r--r-- | base/time.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/base/time.cc b/base/time.cc index 5ce1f80..992e256 100644 --- a/base/time.cc +++ b/base/time.cc @@ -60,6 +60,12 @@ time_t Time::ToTimeT() const { return (us_ - kTimeTToMicrosecondsOffset) / kMicrosecondsPerSecond; } +// static +Time Time::FromDoubleT(double dt) { + return (dt * static_cast<double>(kMicrosecondsPerSecond)) + + kTimeTToMicrosecondsOffset; +} + double Time::ToDoubleT() const { if (us_ == 0) return 0; // Preserve 0 so we can tell it doesn't exist. |