Add Chromium-style TimeDelta, Time and TimeTicks classes, and a new ElapsedTimer...
authorbmeurer@chromium.org <bmeurer@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 28 Aug 2013 11:06:11 +0000 (11:06 +0000)
committerbmeurer@chromium.org <bmeurer@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 28 Aug 2013 11:06:11 +0000 (11:06 +0000)
commitfa5216a1452b6f656726a6e6673f32101ae0744d
treede964929ab6e3880b14d56e394670c9cbd7490dc
parentcfb126c52a41e7903ffe80b1709d82c441a397e8
Add Chromium-style TimeDelta, Time and TimeTicks classes, and a new ElapsedTimer class.

These classes are meant to replace OS::Ticks() and OS::TimeCurrentMillis(),
which are broken in several ways. The ElapsedTimer class implements a
stopwatch using TimeTicks::HighResNow() for high resolution, monotonic
timing.

Also fix the CpuProfile::GetStartTime() and CpuProfile::GetEndTime()
methods to actually return the time relative to the unix epoch as stated
in the documentation (previously that was relative to some arbitrary
point in time, i.e. boot time).

BUG=v8:2853
R=machenbach@chromium.org, yurys@chromium.org

Committed: https://code.google.com/p/v8/source/detail?r=16388

Review URL: https://codereview.chromium.org/23295034

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16390 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
31 files changed:
src/api.cc
src/compiler.cc
src/compiler.h
src/counters.cc
src/counters.h
src/cpu-profiler.cc
src/cpu-profiler.h
src/deoptimizer.cc
src/hydrogen.cc
src/hydrogen.h
src/lithium-allocator.cc
src/log.cc
src/log.h
src/optimizing-compiler-thread.cc
src/optimizing-compiler-thread.h
src/parser.cc
src/platform-linux.cc
src/platform-macos.cc
src/platform-openbsd.cc
src/platform-posix.cc
src/platform-win32.cc
src/platform.h
src/profile-generator.cc
src/profile-generator.h
src/time/elapsed-timer.h [new file with mode: 0644]
src/time/time.cc [new file with mode: 0644]
src/time/time.h [new file with mode: 0644]
test/cctest/cctest.gyp
test/cctest/test-cpu-profiler.cc
test/cctest/test-time.cc [new file with mode: 0644]
tools/gyp/v8.gyp