summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/api/tracing.md4
-rw-r--r--src/tracing/agent.h9
2 files changed, 12 insertions, 1 deletions
diff --git a/doc/api/tracing.md b/doc/api/tracing.md
index e03477b1ad..fbfa2941ef 100644
--- a/doc/api/tracing.md
+++ b/doc/api/tracing.md
@@ -19,3 +19,7 @@ node --trace-events-enabled --trace-event-categories v8,node,node.async_hooks se
Running Node.js with tracing enabled will produce log files that can be opened
in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool)
tab of Chrome.
+
+Starting with Node 10.0.0, the tracing system uses the same time source as the
+one used by `process.hrtime()` however the trace-event timestamps are expressed
+in microseconds, unlike `process.hrtime()` which returns nanoseconds.
diff --git a/src/tracing/agent.h b/src/tracing/agent.h
index bd8e90004b..203f53be7e 100644
--- a/src/tracing/agent.h
+++ b/src/tracing/agent.h
@@ -8,7 +8,14 @@
namespace node {
namespace tracing {
-using v8::platform::tracing::TracingController;
+class TracingController : public v8::platform::tracing::TracingController {
+ public:
+ TracingController() : v8::platform::tracing::TracingController() {}
+
+ int64_t CurrentTimestampMicroseconds() override {
+ return uv_hrtime() / 1000;
+ }
+};
class Agent {
public: