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

Unified Diff: dart/frog/leg/lib/mock.dart

Issue 9419009: Use shared implementation of Stopwatch. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: address review comments Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/frog/leg/lib/coreimpl.dart ('k') | dart/frog/leg/lib/mockimpl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/lib/mock.dart
diff --git a/dart/frog/leg/lib/mock.dart b/dart/frog/leg/lib/mock.dart
index c10a1b605d1a821e7e85070bd10e126cd82cea80..518f98495e4fe0e2be139f1dc5fc814903a41683 100644
--- a/dart/frog/leg/lib/mock.dart
+++ b/dart/frog/leg/lib/mock.dart
@@ -23,51 +23,4 @@ class List<E> implements Iterable<E> {
}
}
-class Stopwatch {
- double startMs;
- double elapsedMs;
-
- Stopwatch() {
- elapsedMs = 0.0;
- }
-
- void start() {
- if (startMs == null) {
- startMs = Primitives.dateNow();
- }
- }
-
- void stop() {
- if (startMs == null) return;
- elapsedMs += Primitives.dateNow() - startMs;
- startMs = null;
- }
-
- void reset() {
- elapsedMs = 0.0;
- if (startMs == null) return;
- startMs = Primitives.dateNow();
- }
-
- int elapsed() {
- return elapsedInMs();
- }
-
- int elapsedInUs() {
- return elapsedInMs() * 1000;
- }
-
- int elapsedInMs() {
- if (startMs == null) {
- return Primitives.mathFloor(elapsedMs);
- } else {
- return Primitives.mathFloor(elapsedMs + (Primitives.dateNow() - startMs));
- }
- }
-
- int frequency() {
- return 1000;
- }
-}
-
void assert(condition) {}
« no previous file with comments | « dart/frog/leg/lib/coreimpl.dart ('k') | dart/frog/leg/lib/mockimpl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698