Package ch.qos.logback.core.util

## Class Duration

- java.lang.Object
- - ch.qos.logback.core.util.Duration

    public class Duration
    extends java.lang.Object

Duration instances represent a lapse of time. Internally, the duration is stored in milliseconds. However, whenever a parameter of type Duration is expected, Joran (logback's configuration system) will automatically convert strings such as "20 seconds" "3.5 minutes" or "5 hours" into Duration instances.

The recognized units of time are the "millisecond", "second", "minute" "hour" and "day". The unit name may be followed by an "s". Thus, "2 day" and "2 days" are equivalent. In the absence of a time unit specification, milliseconds are assumed.

Note: the conversion magic is entirely due to the fact that this class follows the `valueOf(java.lang.String)` convention.

Author:
  Ceki Gulcu

### Constructor Summary

Constructors
`Duration​(long millis)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static Duration` `buildByDays​(double value)`
`static Duration` `buildByHours​(double value)`
`static Duration` `buildByMilliseconds​(double value)`
`static Duration` `buildByMinutes​(double value)`
`static Duration` `buildBySeconds​(double value)`
`static Duration` `buildUnbounded()`
`long` `getMilliseconds()`
`java.lang.String` `toString()`
`static Duration` `valueOf​(java.lang.String durationStr)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### Duration

    public Duration​(long millis)

### Method Detail

#### buildByMilliseconds

    public static Duration buildByMilliseconds​(double value)

#### buildBySeconds

    public static Duration buildBySeconds​(double value)

#### buildByMinutes

    public static Duration buildByMinutes​(double value)

#### buildByHours

    public static Duration buildByHours​(double value)

#### buildByDays

    public static Duration buildByDays​(double value)

#### buildUnbounded

    public static Duration buildUnbounded()

#### getMilliseconds

    public long getMilliseconds()

#### valueOf

    public static Duration valueOf​(java.lang.String durationStr)

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`