@@ -1003,28 +1003,28 @@ To simplify handling of time in concurrent applications `scala.concurrent`
1003
1003
general time abstraction. It is meant to be used with concurrency libraries and
1004
1004
resides in ` scala.concurrent ` package.
1005
1005
1006
- ` Duration ` is the base class representing length of time. It can be either finite or infinite.
1007
- Finite duration is represented with ` FiniteDuration ` class which is constructed from ` Long ` length and
1008
- ` java.util.concurrent.TimeUnit ` . Infinite durations, also extended from ` Duration ` ,
1009
- exist in only two instances , ` Duration.Inf ` and ` Duration.MinusInf ` . Library also
1006
+ ` Duration ` is the base class representing a length of time. It can be either finite or infinite.
1007
+ A finite duration is represented with the ` FiniteDuration ` class, which is constructed from a ` Long ` length and
1008
+ a ` java.util.concurrent.TimeUnit ` . Infinite durations, also extended from ` Duration ` ,
1009
+ exist in only two instances, ` Duration.Inf ` and ` Duration.MinusInf ` . The library also
1010
1010
provides several ` Duration ` subclasses for implicit conversion purposes and those should
1011
1011
not be used.
1012
1012
1013
- Abstract ` Duration ` contains methods that allow :
1013
+ Abstract ` Duration ` contains methods that allow:
1014
1014
1015
1015
1 . Conversion to different time units (` toNanos ` , ` toMicros ` , ` toMillis ` ,
1016
1016
` toSeconds ` , ` toMinutes ` , ` toHours ` , ` toDays ` and ` toUnit(unit: TimeUnit) ` ).
1017
1017
2 . Comparison of durations (` < ` , ` <= ` , ` > ` and ` >= ` ).
1018
1018
3 . Arithmetic operations (` + ` , ` - ` , ` * ` , ` / ` and ` unary_- ` ).
1019
1019
4 . Minimum and maximum between ` this ` duration and the one supplied in the argument (` min ` , ` max ` ).
1020
- 5 . Check if the duration is finite (` isFinite ` ).
1020
+ 5 . Checking whether the duration is finite (` isFinite ` ).
1021
1021
1022
1022
` Duration ` can be instantiated in the following ways:
1023
1023
1024
- 1 . Implicitly from types ` Int ` and ` Long ` . For example ` val d = 100 millis ` .
1025
- 2 . By passing a ` Long ` length and a ` java.util.concurrent.TimeUnit ` .
1026
- For example ` val d = Duration(100, MILLISECONDS) ` .
1027
- 3 . By parsing a string that represent a time period. For example ` val d = Duration("1.2 µs") ` .
1024
+ 1 . Implicitly from types ` Int ` and ` Long ` , for example, ` val d = 100 millis ` .
1025
+ 2 . By passing a ` Long ` length and a ` java.util.concurrent.TimeUnit ` ,
1026
+ for example, ` val d = Duration(100, MILLISECONDS) ` .
1027
+ 3 . By parsing a string that represent a time period, for example, ` val d = Duration("1.2 µs") ` .
1028
1028
1029
1029
Duration also provides ` unapply ` methods so it can be used in pattern matching constructs.
1030
1030
Examples:
0 commit comments