summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Datsenko <dats@chromium.org>2017-08-30 10:46:24 +1000
committerMichaƫl Zasso <targos@protonmail.com>2017-12-06 12:52:07 +0100
commita1ed29b1c63675420832048d330b78c18d0edd77 (patch)
treeb26487e25cd4966d3a9405f252064433ccbb11de
parenta7c5fe9ba63f9d4fd9451c55a2dcd8f1728c2c33 (diff)
downloadandroid-node-v8-a1ed29b1c63675420832048d330b78c18d0edd77.tar.gz
android-node-v8-a1ed29b1c63675420832048d330b78c18d0edd77.tar.bz2
android-node-v8-a1ed29b1c63675420832048d330b78c18d0edd77.zip
src: implement getting current time in NodePlatform
It is required by a change in V8. Refs: https://chromium-review.googlesource.com/c/v8/v8/+/598666 PR-URL: https://github.com/nodejs/node/pull/16271 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Myles Borins <myles.borins@gmail.com>
-rw-r--r--src/node_platform.cc4
-rw-r--r--src/node_platform.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/node_platform.cc b/src/node_platform.cc
index 65d1ef6c5d..d96db08692 100644
--- a/src/node_platform.cc
+++ b/src/node_platform.cc
@@ -279,6 +279,10 @@ double NodePlatform::MonotonicallyIncreasingTime() {
return uv_hrtime() / 1e9;
}
+double NodePlatform::CurrentClockTimeMillis() {
+ return SystemClockTimeMillis();
+}
+
TracingController* NodePlatform::GetTracingController() {
return tracing_controller_.get();
}
diff --git a/src/node_platform.h b/src/node_platform.h
index e5253cac10..b754605787 100644
--- a/src/node_platform.h
+++ b/src/node_platform.h
@@ -127,6 +127,7 @@ class NodePlatform : public MultiIsolatePlatform {
double delay_in_seconds) override;
bool IdleTasksEnabled(v8::Isolate* isolate) override;
double MonotonicallyIncreasingTime() override;
+ double CurrentClockTimeMillis() override;
v8::TracingController* GetTracingController() override;
void FlushForegroundTasks(v8::Isolate* isolate);