summaryrefslogtreecommitdiffstats
path: root/base/time.h
Commit message (Collapse)AuthorAgeFilesLines
* Roll back Markus's CL ( http://codereview.chromium.org/196053)jshin@chromium.org2009-09-251-1/+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/+1
| | | | | | | | | | | | | | | | | | | 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/+4
| | | | | | | | | | | 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-4/+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/+4
| | | | | | | | | | | | | | | 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
* Convert internal time format to Windows 1601 epoch on Linux & Mac.brettw@chromium.org2009-08-261-0/+9
| | | | | | | | | | | Although we represent time internally starting from 1601, there are still things like time explosion that will not work before the year 1900. This limitation is the same as it was previously. BUG=14734 Review URL: http://codereview.chromium.org/173296 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24417 0039d316-1c4b-4281-b951-d872f2087c98
* Do not monitor system power state during unit tests.phajdan.jr@chromium.org2009-05-271-0/+7
| | | | | | | | | | | | | The observer requires that message loop stays up and same through its lifetime. This is not true during testing. TEST=none http://crbug.com/12187 Review URL: http://codereview.chromium.org/113824 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16976 0039d316-1c4b-4281-b951-d872f2087c98
* Retrial of the first step to port file_util::CountFilesCreatedAfter()erikkay@google.com2009-04-181-0/+6
| | | | | | | | | Submitting http://codereview.chromium.org/75033 on behalf of hamaji Review URL: http://codereview.chromium.org/67276 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13993 0039d316-1c4b-4281-b951-d872f2087c98
* - Added support for keeping track of load times.davemoore@chromium.org2009-04-031-1/+3
| | | | | | | | | | | | | | | | | 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
* Remove unneeded includes of gtest_prod.h. Reduce usage from 689 to 601.thestig@chromium.org2009-03-131-1/+0
| | | | | | Review URL: http://codereview.chromium.org/42189 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11680 0039d316-1c4b-4281-b951-d872f2087c98
* Inline the TimeDelta::From* construction functions.deanm@chromium.org2009-01-131-0/+32
| | | | | | | | | 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/+4
| | | | | | Review URL: http://codereview.chromium.org/7995 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4022 0039d316-1c4b-4281-b951-d872f2087c98
* Change to Hi Res timers on Windows.mbelshe@google.com2008-09-261-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two parts of this: 1) TimeTicks:Now() Don't call timeBeginPeriod() in all cases. Use the new SystemMonitor class to watch battery on/off transitions and use the timeBeginPeriod() only when we're using the battery. 2) TimeTicks::UnreliableHiResNow() Change this function from "UnreliableHiResNow()" to "HiResNow()". We still use QPC, but we detect if we're on AMD Athlon XP machines which fail on QPC. For those systems, we fall back to TimeTicks::Now(). Updated tests to detect hardware specifics of timers. Output of the test will contain lines such as these: [ RUN ] TimeTicks.SubMillisecondTimers Min timer is: 1us [ OK ] TimeTicks.SubMillisecondTimers [ RUN ] TimeTicks.TimeGetTimeCaps timeGetTime range is 1 to 1000000ms [ OK ] TimeTicks.TimeGetTimeCaps [ RUN ] TimeTicks.QueryPerformanceFrequency QueryPerformanceFrequency is 2394.18MHz [ OK ] TimeTicks.QueryPerformanceFrequency [ RUN ] TimeTicks.TimerPerformance Time::Now: 0.11us per call TimeTicks::Now: 0.09us per call TimeTicks::HighResNow: 0.26us per call [ OK ] TimeTicks.TimerPerformance Review URL: http://codereview.chromium.org/4092 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2625 0039d316-1c4b-4281-b951-d872f2087c98
* Don't use the Windows high-resolution Time::Now hacks on Posix, the normal ↵deanm@chromium.org2008-09-111-13/+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
* Bulk fixes to get Mac Test Shell more compile-happy.avi@google.com2008-09-091-0/+5
| | | | | | Review URL: http://codereview.chromium.org/1818 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1909 0039d316-1c4b-4281-b951-d872f2087c98
* Reapply r1633 (which was reverted by r1635), with some additional ↵deanm@google.com2008-09-091-3/+2
| | | | | | | | modifications. Consolidate all timer resolution code to time.h, and always depend on TimeTicks::Now for 1ms resolution. Review URL: http://codereview.chromium.org/1806 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1893 0039d316-1c4b-4281-b951-d872f2087c98
* Revert part of r1633 Windows time changes, seems to have caused test failures?deanm@google.com2008-09-021-1/+0
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1635 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup some Windows TimeTicks functions. Move TickTicks::Now and ↵deanm@google.com2008-09-021-0/+1
| | | | | | | | TicksTicks::UnreliableHighResNow to Singletons, which cleans up the code and removes some possible unsafe cross-thread access. Move the Windows-specific rollover tests to time_unittests_win. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1633 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/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1024 0039d316-1c4b-4281-b951-d872f2087c98
* Make POSIX time routines work on Linux by providing a POSIX-conformant ↵mmentovai@google.com2008-08-111-0/+4
| | | | | | version of TimeTicks::Now() to replace the Mach-specific one used on the Mac. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@664 0039d316-1c4b-4281-b951-d872f2087c98
* Add defines for the size of wchar_t to build_config.h. Use this in places ↵brettw@google.com2008-08-071-10/+10
| | | | | | | | | | where we currently have an OS-specific check. Remove all WIN32 ifdefs from base and replace them with proper defined(OS...). I also fixed random style bits when I encountered them. I made major style fixes to string16. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@524 0039d316-1c4b-4281-b951-d872f2087c98
* Add base to the repository.initial.commit2008-07-261-0/+469
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8 0039d316-1c4b-4281-b951-d872f2087c98