OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of dart.developer; | 5 part of dart.developer; |
6 | 6 |
7 typedef dynamic TimelineSyncFunction(); | 7 typedef dynamic TimelineSyncFunction(); |
8 typedef Future TimelineAsyncFunction(); | 8 typedef Future TimelineAsyncFunction(); |
9 | 9 |
10 /// Add to the timeline. | 10 /// Add to the timeline. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 TimelineSyncFunction function, | 61 TimelineSyncFunction function, |
62 {Map arguments}) { | 62 {Map arguments}) { |
63 startSync(name, arguments: arguments); | 63 startSync(name, arguments: arguments); |
64 try { | 64 try { |
65 return function(); | 65 return function(); |
66 } finally { | 66 } finally { |
67 finishSync(); | 67 finishSync(); |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
| 71 /// The current time stamp from the clock used by the timeline. Units are |
| 72 /// microseconds. |
| 73 static int get now => _getTraceClock(); |
71 static final List<_SyncBlock> _stack = new List<_SyncBlock>(); | 74 static final List<_SyncBlock> _stack = new List<_SyncBlock>(); |
72 static final int _isolateId = _getIsolateNum(); | 75 static final int _isolateId = _getIsolateNum(); |
73 static final String _isolateIdString = _isolateId.toString(); | 76 static final String _isolateIdString = _isolateId.toString(); |
74 } | 77 } |
75 | 78 |
76 /// An asynchronous task on the timeline. An asynchronous task can have many | 79 /// An asynchronous task on the timeline. An asynchronous task can have many |
77 /// (nested) synchronous operations. Synchronous operations can live longer than | 80 /// (nested) synchronous operations. Synchronous operations can live longer than |
78 /// the current isolate event. To pass a [TimelineTask] to another isolate, | 81 /// the current isolate event. To pass a [TimelineTask] to another isolate, |
79 /// you must first call [pass] to get the task id and then construct a new | 82 /// you must first call [pass] to get the task id and then construct a new |
80 /// [TimelineTask] in the other isolate. | 83 /// [TimelineTask] in the other isolate. |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 int end, | 260 int end, |
258 String category, | 261 String category, |
259 String name, | 262 String name, |
260 String argumentsAsJson); | 263 String argumentsAsJson); |
261 | 264 |
262 /// Reports an instant event. | 265 /// Reports an instant event. |
263 external void _reportInstantEvent(int start, | 266 external void _reportInstantEvent(int start, |
264 String category, | 267 String category, |
265 String name, | 268 String name, |
266 String argumentsAsJson); | 269 String argumentsAsJson); |
OLD | NEW |