Skip to content

Commit 92701df

Browse files
rmacnak-googlecommit-bot@chromium.org
authored andcommitted
[vm] Document clock compatibility between Timeline.now and Dart_TimelineGetMicros.
Change-Id: Ife4b5360b9c42221b9dac84014d072f60cd8f11c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106720 Commit-Queue: Ryan Macnak <[email protected]> Reviewed-by: Ben Konyi <[email protected]> Reviewed-by: Siva Annamalai <[email protected]>
1 parent 1734133 commit 92701df

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

runtime/include/dart_tools_api.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,8 @@ DART_EXPORT bool Dart_IsReloading();
301301

302302
/**
303303
* Returns a timestamp in microseconds. This timestamp is suitable for
304-
* passing into the timeline system.
304+
* passing into the timeline system, and uses the same monotonic clock
305+
* as dart:developer's Timeline.now.
305306
*
306307
* \return A timestamp that can be passed to the timeline system.
307308
*/

runtime/vm/service/service.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,8 @@ The _getVMTimeline_ RPC is used to retrieve an object which contains VM timeline
797797
events.
798798

799799
The _timeOriginMicros_ parameter is the beginning of the time range used to filter
800-
timeline events.
800+
timeline events. It uses the same monotonic clock as dart:developer's `Timeline.now`
801+
and the VM embedding API's `Dart_TimelineGetMicros`.
801802

802803
The _timeExtentMicros_ parameter specifies how large the time range used to filter
803804
timeline events should be.

runtime/vm/service/service_dev.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,8 @@ The _getVMTimeline_ RPC is used to retrieve an object which contains VM timeline
797797
events.
798798

799799
The _timeOriginMicros_ parameter is the beginning of the time range used to filter
800-
timeline events.
800+
timeline events. It uses the same monotonic clock as dart:developer's `Timeline.now`
801+
and the VM embedding API's `Dart_TimelineGetMicros`.
801802

802803
The _timeExtentMicros_ parameter specifies how large the time range used to filter
803804
timeline events should be.

sdk/lib/developer/timeline.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ class Timeline {
166166

167167
/// The current time stamp from the clock used by the timeline. Units are
168168
/// microseconds.
169+
///
170+
/// When run on the Dart VM, uses the same monotonic clock as the embedding
171+
/// API's `Dart_TimelineGetMicros`.
169172
static int get now => _getTraceClock();
170173
static final List<_SyncBlock> _stack = new List<_SyncBlock>();
171174
}

0 commit comments

Comments
 (0)