Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: runtime/lib/timeline.cc

Issue 1504523002: Use a monotonic clock in the implementation of Stopwatch. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/lib/stopwatch.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "vm/bootstrap_natives.h" 5 #include "vm/bootstrap_natives.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "vm/native_entry.h" 9 #include "vm/native_entry.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 14 matching lines...) Expand all
25 DEFINE_NATIVE_ENTRY(Timeline_getNextAsyncId, 0) { 25 DEFINE_NATIVE_ENTRY(Timeline_getNextAsyncId, 0) {
26 TimelineEventRecorder* recorder = Timeline::recorder(); 26 TimelineEventRecorder* recorder = Timeline::recorder();
27 if (recorder == NULL) { 27 if (recorder == NULL) {
28 return Integer::New(0); 28 return Integer::New(0);
29 } 29 }
30 return Integer::New(recorder->GetNextAsyncId()); 30 return Integer::New(recorder->GetNextAsyncId());
31 } 31 }
32 32
33 33
34 DEFINE_NATIVE_ENTRY(Timeline_getTraceClock, 0) { 34 DEFINE_NATIVE_ENTRY(Timeline_getTraceClock, 0) {
35 return Integer::New(OS::GetCurrentTraceMicros(), Heap::kNew, true); 35 return Integer::New(OS::GetCurrentMonotonicMicros(), Heap::kNew, true);
36 } 36 }
37 37
38 38
39 DEFINE_NATIVE_ENTRY(Timeline_reportTaskEvent, 6) { 39 DEFINE_NATIVE_ENTRY(Timeline_reportTaskEvent, 6) {
40 GET_NON_NULL_NATIVE_ARGUMENT(Integer, start, arguments->NativeArgAt(0)); 40 GET_NON_NULL_NATIVE_ARGUMENT(Integer, start, arguments->NativeArgAt(0));
41 GET_NON_NULL_NATIVE_ARGUMENT(Integer, id, arguments->NativeArgAt(1)); 41 GET_NON_NULL_NATIVE_ARGUMENT(Integer, id, arguments->NativeArgAt(1));
42 GET_NON_NULL_NATIVE_ARGUMENT(String, phase, arguments->NativeArgAt(2)); 42 GET_NON_NULL_NATIVE_ARGUMENT(String, phase, arguments->NativeArgAt(2));
43 GET_NON_NULL_NATIVE_ARGUMENT(String, category, arguments->NativeArgAt(3)); 43 GET_NON_NULL_NATIVE_ARGUMENT(String, category, arguments->NativeArgAt(3));
44 GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(4)); 44 GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(4));
45 GET_NON_NULL_NATIVE_ARGUMENT(String, args, arguments->NativeArgAt(5)); 45 GET_NON_NULL_NATIVE_ARGUMENT(String, args, arguments->NativeArgAt(5));
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 return Object::null(); 168 return Object::null();
169 } 169 }
170 // json was allocated in the zone and a copy will be stored in event. 170 // json was allocated in the zone and a copy will be stored in event.
171 event->SerializedJSON(json); 171 event->SerializedJSON(json);
172 event->Complete(); 172 event->Complete();
173 173
174 return Object::null(); 174 return Object::null();
175 } 175 }
176 176
177 } // namespace dart 177 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/stopwatch.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698