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

Side by Side Diff: test/dart_codegen/expect/core/stopwatch.dart

Issue 1071393007: fuse List and js Array together and a few other misc fixes. (Closed) Base URL: git@github.com:dart-lang/dart-dev-compiler.git@master
Patch Set: ptal Created 5 years, 8 months 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 | « test/dart_codegen/expect/core/list.dart ('k') | test/dart_codegen/expect/core/uri.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 part of dart.core; 1 part of dart.core;
2 class Stopwatch {int get frequency => _frequency; 2 class Stopwatch {int get frequency => _frequency;
3 num _start; 3 num _start;
4 num _stop; 4 num _stop;
5 Stopwatch() { 5 Stopwatch() {
6 _initTicker(); 6 _initTicker();
7 } 7 }
8 void start() { 8 void start() {
9 if (isRunning) return; if (_start == null) { 9 if (isRunning) return; if (_start == null) {
10 _start = _now(); 10 _start = _now();
11 } 11 }
12 else { 12 else {
13 _start = _now() - (_stop - _start); 13 _start = _now() - (_stop - _start);
14 _stop = null; 14 _stop = null;
15 } 15 }
16 } 16 }
17 void stop() { 17 void stop() {
18 if (!isRunning) return; _stop = _now(); 18 if (!isRunning) return; _stop = _now();
19 } 19 }
20 void reset() { 20 void reset() {
21 if (_start == null) return; _start = _now(); 21 if (_start == null) return; _start = _now();
22 if (_stop != null) { 22 if (_stop != null) {
23 _stop = _start; 23 _stop = _start;
24 } 24 }
25 } 25 }
26 int get elapsedTicks { 26 int get elapsedTicks {
27 if (_start == null) { 27 if (_start == null) {
28 return 0; 28 return 0;
29 } 29 }
30 return ((__x9) => DEVC$RT.cast(__x9, num, int, "ImplicitCast", """line 102, c olumn 12 of dart:core/stopwatch.dart: """, __x9 is int, true))((_stop == null) ? (_now() - _start) : (_stop - _start)); 30 return ((__x20) => DEVC$RT.cast(__x20, num, int, "ImplicitCast", """line 102, column 12 of dart:core/stopwatch.dart: """, __x20 is int, true))((_stop == null ) ? (_now() - _start) : (_stop - _start));
31 } 31 }
32 Duration get elapsed { 32 Duration get elapsed {
33 return new Duration(microseconds: elapsedMicroseconds); 33 return new Duration(microseconds: elapsedMicroseconds);
34 } 34 }
35 int get elapsedMicroseconds { 35 int get elapsedMicroseconds {
36 return (elapsedTicks * 1000000) ~/ frequency; 36 return (elapsedTicks * 1000000) ~/ frequency;
37 } 37 }
38 int get elapsedMilliseconds { 38 int get elapsedMilliseconds {
39 return (elapsedTicks * 1000) ~/ frequency; 39 return (elapsedTicks * 1000) ~/ frequency;
40 } 40 }
41 bool get isRunning => _start != null && _stop == null; 41 bool get isRunning => _start != null && _stop == null;
42 static int _frequency; 42 static int _frequency;
43 external static void _initTicker(); 43 external static void _initTicker();
44 external static int _now(); 44 external static int _now();
45 } 45 }
OLDNEW
« no previous file with comments | « test/dart_codegen/expect/core/list.dart ('k') | test/dart_codegen/expect/core/uri.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698