| Index: include/v8-platform.h
|
| diff --git a/include/v8-platform.h b/include/v8-platform.h
|
| index 75fddd59a873b75db0d05bd1e3fc733b1e1a9265..214c1e52eab0b011c2d5d9616dfcc752ab4f1849 100644
|
| --- a/include/v8-platform.h
|
| +++ b/include/v8-platform.h
|
| @@ -77,6 +77,65 @@ class Platform {
|
| */
|
| virtual void CallOnForegroundThread(Isolate* isolate, Task* task) = 0;
|
|
|
| + /**
|
| + * The current time, represented as microseconds (s/1,000,000) since
|
| + * 00:00:00 UTC, January 1, 1970.
|
| + *
|
| + * This value can go backwards, if the system adjusts its clock.
|
| + */
|
| + virtual int64_t CurrentTime();
|
| +
|
| + /**
|
| + * The current time, represented as microseconds (s/1,000,000) since
|
| + * 00:00:00 UTC, January 1, 1970.
|
| + *
|
| + * This function always uses system time so that there are no discrepancies
|
| + * between the returned time and system time even on virtual environments,
|
| + * including our test bot.
|
| + *
|
| + * This value can go backwards, if the system adjusts its clock.
|
| + *
|
| + * This function is used for timing sensitive unittests.
|
| + */
|
| + virtual int64_t CurrentTimeFromSystemTime();
|
| +
|
| + /**
|
| + * An abstract time intended for use in measuring time durations, represented
|
| + * as microseconds.
|
| + *
|
| + * This is guaranteed not to decrease even if the computer clock goes
|
| + * backwards, but it may "stand still", for example if the computer is
|
| + * suspended.
|
| + *
|
| + * The resolution of this clock can be as low as 15ms, and it varies
|
| + * depending on hardware/operating system.
|
| + *
|
| + * This method never returns 0.
|
| + */
|
| + virtual int64_t TimeTicksNow();
|
| +
|
| + /**
|
| + * An abstract time intended for use in measuring time durations, represented
|
| + * as microseconds.
|
| + *
|
| + * This is guaranteed not to decrease even if the computer clock goes
|
| + * backwards, but it may "stand still", for example if the computer is
|
| + * suspended.
|
| + *
|
| + * The implementation is hardware dependent and its return values may or may
|
| + * not have sub-millisecond resolution. THIS CALL IS GENERALLY MUCH MORE
|
| + * EXPENSIVE THAN TimeTicksNow() AND SHOULD ONLY BE USED WHEN IT IS REALLY
|
| + * NEEDED.
|
| + *
|
| + * This method never returns 0.
|
| + */
|
| + virtual int64_t TimeTicksHighResNow();
|
| +
|
| + /**
|
| + * True if the TimeTicksHighResNow() returns values with high resolution.
|
| + */
|
| + virtual bool TimeTicksHasHighRes();
|
| +
|
| protected:
|
| virtual ~Platform() {}
|
| };
|
|
|