OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #import("dart:io"); |
| 6 |
5 class TimerRepeatTest { | 7 class TimerRepeatTest { |
6 | 8 |
7 static final int _TIMEOUT = 500; | 9 static final int _TIMEOUT = 500; |
8 static final int _ITERATIONS = 5; | 10 static final int _ITERATIONS = 5; |
9 | 11 |
10 static void testRepeatTimer() { | 12 static void testRepeatTimer() { |
11 | 13 |
12 void timeoutHandler(Timer timer) { | 14 void timeoutHandler(Timer timer) { |
13 int endTime = (new Date.now()).value; | 15 int endTime = (new Date.now()).value; |
14 _iteration++; | 16 _iteration++; |
(...skipping 15 matching lines...) Expand all Loading... |
30 } | 32 } |
31 | 33 |
32 static Timer timer; | 34 static Timer timer; |
33 static int _startTime; | 35 static int _startTime; |
34 static int _iteration; | 36 static int _iteration; |
35 } | 37 } |
36 | 38 |
37 main() { | 39 main() { |
38 TimerRepeatTest.testMain(); | 40 TimerRepeatTest.testMain(); |
39 } | 41 } |
OLD | NEW |