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

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

Issue 1148283010: Remove dart backend (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 6 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
OLDNEW
(Empty)
1 part of dart.core;
2 class Stopwatch {int get frequency => _frequency;
3 num _start;
4 num _stop;
5 Stopwatch() {
6 _initTicker();
7 }
8 void start() {
9 if (isRunning) return; if (_start == null) {
10 _start = _now();
11 }
12 else {
13 _start = _now() - (_stop - _start);
14 _stop = null;
15 }
16 }
17 void stop() {
18 if (!isRunning) return; _stop = _now();
19 }
20 void reset() {
21 if (_start == null) return; _start = _now();
22 if (_stop != null) {
23 _stop = _start;
24 }
25 }
26 int get elapsedTicks {
27 if (_start == null) {
28 return 0;
29 }
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 }
32 Duration get elapsed {
33 return new Duration(microseconds: elapsedMicroseconds);
34 }
35 int get elapsedMicroseconds {
36 return (elapsedTicks * 1000000) ~/ frequency;
37 }
38 int get elapsedMilliseconds {
39 return (elapsedTicks * 1000) ~/ frequency;
40 }
41 bool get isRunning => _start != null && _stop == null;
42 static int _frequency;
43 external static void _initTicker();
44 external static int _now();
45 }
OLDNEW
« no previous file with comments | « test/dart_codegen/expect/core/stacktrace.dart ('k') | test/dart_codegen/expect/core/string.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698