diff --git a/runtime/include/dart_tools_api.h b/runtime/include/dart_tools_api.h index 03b38aa5e1e..b4985bfb837 100644 --- a/runtime/include/dart_tools_api.h +++ b/runtime/include/dart_tools_api.h @@ -301,7 +301,8 @@ DART_EXPORT bool Dart_IsReloading(); /** * Returns a timestamp in microseconds. This timestamp is suitable for - * passing into the timeline system. + * passing into the timeline system, and uses the same monotonic clock + * as dart:developer's Timeline.now. * * \return A timestamp that can be passed to the timeline system. */ diff --git a/runtime/vm/service/service.md b/runtime/vm/service/service.md index 52eea6b05e0..d01f0ef4ab2 100644 --- a/runtime/vm/service/service.md +++ b/runtime/vm/service/service.md @@ -797,7 +797,8 @@ The _getVMTimeline_ RPC is used to retrieve an object which contains VM timeline events. The _timeOriginMicros_ parameter is the beginning of the time range used to filter -timeline events. +timeline events. It uses the same monotonic clock as dart:developer's `Timeline.now` +and the VM embedding API's `Dart_TimelineGetMicros`. The _timeExtentMicros_ parameter specifies how large the time range used to filter timeline events should be. diff --git a/runtime/vm/service/service_dev.md b/runtime/vm/service/service_dev.md index 148ee394b9b..bfc5fa9f33e 100644 --- a/runtime/vm/service/service_dev.md +++ b/runtime/vm/service/service_dev.md @@ -797,7 +797,8 @@ The _getVMTimeline_ RPC is used to retrieve an object which contains VM timeline events. The _timeOriginMicros_ parameter is the beginning of the time range used to filter -timeline events. +timeline events. It uses the same monotonic clock as dart:developer's `Timeline.now` +and the VM embedding API's `Dart_TimelineGetMicros`. The _timeExtentMicros_ parameter specifies how large the time range used to filter timeline events should be. diff --git a/sdk/lib/developer/timeline.dart b/sdk/lib/developer/timeline.dart index b18ed9374c9..72d28aff824 100644 --- a/sdk/lib/developer/timeline.dart +++ b/sdk/lib/developer/timeline.dart @@ -166,6 +166,9 @@ class Timeline { /// The current time stamp from the clock used by the timeline. Units are /// microseconds. + /// + /// When run on the Dart VM, uses the same monotonic clock as the embedding + /// API's `Dart_TimelineGetMicros`. static int get now => _getTraceClock(); static final List<_SyncBlock> _stack = new List<_SyncBlock>(); }