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 // Dart core library. | 5 part of dart.core; |
6 | 6 |
7 /** | 7 /** |
8 * A [Duration] represents a time span. A duration can be negative. | 8 * A [Duration] represents a time span. A duration can be negative. |
9 */ | 9 */ |
10 class Duration implements Comparable { | 10 class Duration implements Comparable { |
11 static const int MILLISECONDS_PER_SECOND = 1000; | 11 static const int MILLISECONDS_PER_SECOND = 1000; |
12 static const int SECONDS_PER_MINUTE = 60; | 12 static const int SECONDS_PER_MINUTE = 60; |
13 static const int MINUTES_PER_HOUR = 60; | 13 static const int MINUTES_PER_HOUR = 60; |
14 static const int HOURS_PER_DAY = 24; | 14 static const int HOURS_PER_DAY = 24; |
15 | 15 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 } | 111 } |
112 String twoDigitMinutes = | 112 String twoDigitMinutes = |
113 twoDigits(inMinutes.remainder(Duration.MINUTES_PER_HOUR)); | 113 twoDigits(inMinutes.remainder(Duration.MINUTES_PER_HOUR)); |
114 String twoDigitSeconds = | 114 String twoDigitSeconds = |
115 twoDigits(inSeconds.remainder(Duration.SECONDS_PER_MINUTE)); | 115 twoDigits(inSeconds.remainder(Duration.SECONDS_PER_MINUTE)); |
116 String threeDigitMs = | 116 String threeDigitMs = |
117 threeDigits(inMilliseconds.remainder(Duration.MILLISECONDS_PER_SECOND)); | 117 threeDigits(inMilliseconds.remainder(Duration.MILLISECONDS_PER_SECOND)); |
118 return "$inHours:$twoDigitMinutes:$twoDigitSeconds.$threeDigitMs"; | 118 return "$inHours:$twoDigitMinutes:$twoDigitSeconds.$threeDigitMs"; |
119 } | 119 } |
120 } | 120 } |
OLD | NEW |