Airlift has a good duration/timespan abstraction if I were to poach one
from an existing project today.


On Tue, Nov 26, 2013 at 10:28 AM, akarnokd <notifications@github.com> wrote:

> In rxjava-core/src/main/java/rx/util/TimeSpan.java:
>
> > +package rx.util;
> > +
> > +import java.util.concurrent.TimeUnit;
> > +
> > +/**
> > + * Represents a time value and time unit.
> > + * <p>
> > + * Rx.NET note: System.TimeSpan has a fixed unit of measure of 100 nanoseconds
> > + * per value; the Java way is to specify the TimeUnit along with the time value.
> > + * <p>
> > + * Usage:
> > + * <pre>
> > + * TimeSpan oneSecond = TimeSpan.of(1, TimeUnit.SECONDS);
> > + * </pre>
> > + */
> > +public final class TimeSpan implements Comparable<TimeSpan> {
>
> We can return rx.util.TimeInterval<TimeUnit> so no new class needs to be
> introduced, but since TimeInterval is specified as having a millisecond
> value, it would confuse things.
>
> One option is always there: "when in doubt, leave it out". So there won't
> be any timed overload, and if particular clients require one, they can
> write their own time generator and zip() it with generate()
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Netflix/RxJava/pull/509/files#r7934024>
> .
>