Class containing methods that return a Span time value calculated from the
Double value passed to the FloatingGrainOfTime constructor.
Class containing methods that return a Span time value calculated from the
Double value passed to the FloatingGrainOfTime constructor.
Class containing methods that return a Span time value calculated from the
Long value passed to the GrainOfTime constructor.
Class containing methods that return a Span time value calculated from the
Long value passed to the GrainOfTime constructor.
Implicit conversion that adds time units methods to Doubles.
Implicit conversion that adds time units methods to Doubles.
a FloatingGrainOfTime wrapping the passed Double
Implicit conversion that adds time units methods to Floats.
Implicit conversion that adds time units methods to Floats.
a FloatingGrainOfTime wrapping the passed Float
Implicit conversion that adds time units methods to Ints.
Implicit conversion that adds time units methods to Ints.
a GrainOfTime wrapping the passed Int
Implicit conversion that adds time units methods to Longs.
Implicit conversion that adds time units methods to Longs.
a GrainOfTime wrapping the passed Long
Trait providing four implicit conversions that allow you to specify spans of time by invoking "units" methods such as
millis,seconds, andminutesonInt,Long,Float, andDouble.This trait enables you to specify a span of time in a clear, boilerplate-free way when you need to provide an instance of
Span. This can be used, for example, with thefailAftermethod of traitTimeoutsor thetimeLimitfield of traitTimeLimitedTests. It can also be used to specify timeouts when using traitsEventually,Futures,Waiter. Here are examples of each unit enabled by this trait:IntLongFloatDoubleThis trait is not the default way to specify
Spans for two reasons. First, it adds four implicits, which would give the compiler more work to do and may conflict with other implicits the user has in scope. Instead,Spanprovides a clear, concise default way to specify time spans that requires no implicits. Here's an example:If you already have implicit conversions in scope that provide a similar syntax sugar for expression time spans, you can use that by providing an implicit conversion from the result of those expressions to
Span. Note that because of implicit conversions in theSpancompanion object, you can use ascala.concurrent.duration.Duration(including in its "sugary" form) where aSpanis needed, and vice versa.