From 0ed164e082da20a6b431271aba6d92de0ff08944 Mon Sep 17 00:00:00 2001 From: Aleksey Kozyatinskiy Date: Sat, 21 Jul 2018 00:52:48 -0700 Subject: [PATCH] inspector: fixed V8InspectorClient::currentTimeMS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On inspector side inside V8 we assume that this method should return number of ms since epoch. PR-URL: https://github.com/nodejs/node/pull/21917 Reviewed-By: Michaƫl Zasso Reviewed-By: Gus Caplan Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: Tiancheng "Timothy" Gu Reviewed-By: Jon Moss --- src/inspector_agent.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index ebb8d8a1616..0b99217d0a3 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -187,8 +187,6 @@ static int StartDebugSignalHandler() { #endif // _WIN32 -// Used in NodeInspectorClient::currentTimeMS() below. -const int NANOS_PER_MSEC = 1000000; const int CONTEXT_GROUP_ID = 1; class ChannelImpl final : public v8_inspector::V8Inspector::Channel, @@ -593,7 +591,7 @@ class NodeInspectorClient : public V8InspectorClient { } double currentTimeMS() override { - return uv_hrtime() * 1.0 / NANOS_PER_MSEC; + return env_->isolate_data()->platform()->CurrentClockTimeMillis(); } node::Environment* env_;