summaryrefslogtreecommitdiffstats
path: root/base/time.cc
Commit message (Collapse)AuthorAgeFilesLines
* This is a second attempt at submitting this changelist. The original one wasmarkus@chromium.org2009-10-131-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://codereview.chromium.org/196053 It turns out, since none of our tests abstract time correctly, unittests are very sensitive to subtle changes in timing. This made some of the valgrind tests on Linux fail, and unfortunately, neither my desktop nor the trybots could reproduce the problem reliably. As far as I can tell, all the (design) bugs are in the unittests. The browser is actually fine. Tweaked the code a little more. Will resubmit and carefully monitor the buildbots. Original change description follows: When converting between units of time or data types of different precision, we have to be careful to consistently round in the same direction. Timeout checks usually check if Now() is less or equal to a deadline in order to determine if a timeout has occurred. This correctly handles the case where actual sleep times are equal or longer than requested sleep times. But if we round down when setting the sleep delay, this can result in unnecessary and expensive looping. Make sure, we always round up when converting to a format with less precision. BUG=none TEST=none Review URL: http://codereview.chromium.org/257044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28801 0039d316-1c4b-4281-b951-d872f2087c98
* Roll back Markus's CL ( http://codereview.chromium.org/196053)jshin@chromium.org2009-09-251-5/+0
| | | | | | | | | BUG=none TEST=UI test and valgrind test pass TBR=markus Review URL: http://codereview.chromium.org/222031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27160 0039d316-1c4b-4281-b951-d872f2087c98
* When converting between units of time or data types of different precision,markus@chromium.org2009-09-241-0/+5
| | | | | | | | | | | | | | | | | | | we have to be careful to consistently round in the same direction. Timeout checks usually check if Now() is less or equal to a deadline in order to determine if a timeout has occurred. This correctly handles the case where actual sleep times are equal or longer than requested sleep times. But if we round down when setting the sleep delay, this can result in unnecessary and expensive looping. Make sure, we always round up when converting to a format with less precision. BUG=none TEST=none Review URL: http://codereview.chromium.org/196053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27146 0039d316-1c4b-4281-b951-d872f2087c98
* Make int64 -> Time conversion explicit.phajdan.jr@chromium.org2009-09-141-4/+5
| | | | | | | | | | | Landing Patch for Jacob Mandelson, original review: http://codereview.chromium.org/200093 BUG=none TEST=base_unittests & app_unittests Review URL: http://codereview.chromium.org/205003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26134 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Fix a ton of compiler warnings."tony@chromium.org2009-08-281-5/+4
| | | | | | | | | | | This reverts commit r24792. TBR=estade Review URL: http://codereview.chromium.org/179028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24796 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a ton of compiler warnings.estade@chromium.org2009-08-281-4/+5
| | | | | | | | | | | | | | | Most of these are classes with virtual methods lacking virtual destructors or NULL used in non-pointer context. BUG=none TEST=app_unittests && base_unittests --gtest_filter=-ConditionVariableTest.LargeFastTaskTest patch by Jacob Mandelson <jlmjlm [at] gmail> http://codereview.chromium.org/171028/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24792 0039d316-1c4b-4281-b951-d872f2087c98
* - Added support for keeping track of load times.davemoore@chromium.org2009-04-031-0/+6
| | | | | | | | | | | | | | | | | 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
* This CL adds macro used to track the creation and destructionjcampan@chromium.org2009-02-041-1/+2
| | | | | | | | | | | of HWNDs, in an attempt to detect potential double-delete. A double-delete of a HWND might be responsible for the crasher http://crbug.com/4714 Note: this CL was previously committed and reverted because it broke the sandbox integration module. Review URL: http://codereview.chromium.org/21032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9161 0039d316-1c4b-4281-b951-d872f2087c98
* Inline the TimeDelta::From* construction functions.deanm@chromium.org2009-01-131-30/+0
| | | | | | | | | With GCC, we don't have much hope of inlining unless the defintion is in the header. This should also hopefully allow the compiler to do things like constant folding on the multiplications, etc. Review URL: http://codereview.chromium.org/17802 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7928 0039d316-1c4b-4281-b951-d872f2087c98
* Move Time, TimeDelta and TimeTicks into namespace base.dsh@google.com2008-10-271-0/+3
| | | | | | Review URL: http://codereview.chromium.org/7995 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4022 0039d316-1c4b-4281-b951-d872f2087c98
* Don't use the Windows high-resolution Time::Now hacks on Posix, the normal ↵deanm@chromium.org2008-09-111-48/+0
| | | | | | | | resultion from the time APIs there should be enough. Review URL: http://codereview.chromium.org/2420 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2056 0039d316-1c4b-4281-b951-d872f2087c98
* Use a more compact license header in source files.license.bot2008-08-241-28/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
* Add tests for From / In converions and LocalMidnight. Add InMinutes().deanm@google.com2008-08-191-0/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1024 0039d316-1c4b-4281-b951-d872f2087c98
* Add base to the repository.initial.commit2008-07-261-0/+190
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8 0039d316-1c4b-4281-b951-d872f2087c98