Commit 837b8016 authored by Sergei D's avatar Sergei D Committed by Commit Bot

Export default implementation of getting wall-clock time.

Derived projects need easy access to the original V8's implementation of
time to implement Platform interface.

Bug: chromium:751993
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I97ee77929fda5930e7d75ca8609797673485cec3
Reviewed-on: https://chromium-review.googlesource.com/636884Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Sergei Datsenko <dats@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47638}
parent 5bd5fd45
......@@ -226,6 +226,14 @@ class Platform {
* Returns an instance of a v8::TracingController. This must be non-nullptr.
*/
virtual TracingController* GetTracingController() = 0;
protected:
/**
* Default implementation of current wall-clock time in milliseconds
* since epoch. Useful for implementing |CurrentClockTimeMillis| if
* nothing special needed.
*/
static double SystemClockTimeMillis();
};
} // namespace v8
......
......@@ -130,4 +130,9 @@ void V8::SetSnapshotBlob(StartupData* snapshot_blob) {
#endif
}
} // namespace internal
// static
double Platform::SystemClockTimeMillis() {
return base::OS::TimeCurrentMillis();
}
} // namespace v8
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment