com.twitter.util

Duration

object Duration extends TimeLikeOps[Duration] with Serializable

Linear Supertypes
Serializable, Serializable, TimeLikeOps[Duration], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Duration
  2. Serializable
  3. Serializable
  4. TimeLikeOps
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. val Bottom: Duration

    Duration Bottom is smaller than any other duration, except for itself.

    Duration Bottom is smaller than any other duration, except for itself. Bottom's complement is Top.

    Definition Classes
    DurationTimeLikeOps
  5. object Finite

    An extractor for finite TimeLikes; eg.:

    An extractor for finite TimeLikes; eg.:

    duration match {
    case Duration.Finite(d) => ...
    case Duration.Top => ..
    Definition Classes
    TimeLikeOps
  6. val NanosPerDay: Long

  7. val NanosPerHour: Long

  8. val NanosPerMicrosecond: Long

  9. val NanosPerMillisecond: Long

  10. val NanosPerMinute: Long

  11. val NanosPerSecond: Long

  12. object Nanoseconds

    An extractor for finite This, yielding its value in nanoseconds.

    An extractor for finite This, yielding its value in nanoseconds.

    duration match {
    case Duration.Nanoseconds(ns) => ...
    case Duration.Top => ...
    }
    Definition Classes
    TimeLikeOps
  13. val Top: Duration

    Duration Top is greater than any other duration, except for itself.

    Duration Top is greater than any other duration, except for itself. Top's complement is Bottom.

    Definition Classes
    DurationTimeLikeOps
  14. val Undefined: Duration

    An undefined value: behaves like Double.NaN

    An undefined value: behaves like Double.NaN

    Definition Classes
    DurationTimeLikeOps
  15. val Zero: Duration

    The zero value

    The zero value

    Definition Classes
    TimeLikeOps
  16. def apply(value: Long, unit: TimeUnit): Duration

    Create a duration from a java.util.concurrent.TimeUnit.

  17. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  18. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  20. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  21. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. def fromMicroseconds(micros: Long): Duration

    Definition Classes
    TimeLikeOps
  23. def fromMilliseconds(millis: Long): Duration

    Definition Classes
    DurationTimeLikeOps
  24. def fromNanoseconds(nanoseconds: Long): Duration

    Make a new This from the given number of nanoseconds

    Make a new This from the given number of nanoseconds

    Definition Classes
    DurationTimeLikeOps
  25. def fromSeconds(seconds: Int): Duration

    Definition Classes
    DurationTimeLikeOps
  26. def fromTimeUnit(value: Long, unit: TimeUnit): Duration

    Create a duration from a java.util.concurrent.TimeUnit.

    Create a duration from a java.util.concurrent.TimeUnit. Synonyn for apply.

  27. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  28. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  29. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  30. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  31. final def notify(): Unit

    Definition Classes
    AnyRef
  32. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  33. def parse(s: String): Duration

    Parse a String representation of a duration.

    Parse a String representation of a duration. This method will parse any duration generated by Duration.toString.

    The format is either one of the special values, or non-empty sequence of durations. Each duration is a sign, an integer, a dot, and a unit. The unit may be plural or singular. The parser will ignore whitespace around signs and at the beginning and end. (That is, it accepts "1.second + 1.minute" and " 1.second ".) It's permissible to omit the sign before the first duration.

    The special values are "Duration.Top", "Duration.Bottom" and "Duration.Undefined".

    The parser is case-insensitive.

    Exceptions thrown
    RuntimeException

    if the string cannot be parsed.

  34. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  35. def toString(): String

    Definition Classes
    AnyRef → Any
  36. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. val MaxValue: Duration

    Annotations
    @deprecated
    Deprecated

    (Since version 5.4.0) Use Duration.Top

  2. val MinValue: Duration

    Annotations
    @deprecated
    Deprecated

    (Since version 5.4.0) Use Duration.Zero

  3. val eternity: Duration

    Synonym to Top

    Synonym to Top

    Annotations
    @deprecated
    Deprecated

    (Since version 5.4.0) use Duration.Top

  4. val forever: Duration

    Synonym to Top

    Synonym to Top

    Annotations
    @deprecated
    Deprecated

    (Since version 5.4.0) use Duration.Top

  5. def inMilliseconds[T](f: ⇒ T): (T, Duration)

    Returns how long it took, in millisecond granularity, to run the function f.

    Returns how long it took, in millisecond granularity, to run the function f.

    Annotations
    @deprecated
    Deprecated

    (Since version 5.4.0) use Stopwatch instead

  6. def inNanoseconds[T](f: ⇒ T): (T, Duration)

    Returns how long it took, in nanosecond granularity, to run the function f.

    Returns how long it took, in nanosecond granularity, to run the function f.

    Annotations
    @deprecated
    Deprecated

    (Since version 5.4.0) Use Stopwatch

  7. def since(time: Time): Duration

    Annotations
    @deprecated
    Deprecated

    (Since version 2011-05-03) use time.untilNow

  8. val zero: Duration

    Annotations
    @deprecated
    Deprecated

    (Since version 5.4.0) use Duration.Zero

Inherited from Serializable

Inherited from Serializable

Inherited from TimeLikeOps[Duration]

Inherited from AnyRef

Inherited from Any

Ungrouped