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 10:59:07 +0000 (10:59 +0000)
committerbmeurer@chromium.org <bmeurer@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 28 Aug 2013 10:59:07 +0000 (10:59 +0000)
commit8faf4d4291b4e6cfb9e3c888477ead4e471d7bb8
treea4e75f0800ad7e1f84b0b8049651998adf7b6e11
parentf156ae52820b9a64de433591c9a5d176b9b74d65
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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16388 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