TimeFrame

data class TimeFrame(val number: Long, val unit: TimeUnit) : Comparable<TimeFrame>

Class denoting a length of time that is easily convertible into any required time units.

The class is Comparable for easy comparison. Although it should be noted that the comparison may not be reliable when comparing very large units with very small units as the conversions are taken from TimeUnit which will truncate limit conversions to Long.MAX_VALUE/Long.MIN_VALUE in cases when a conversion would exceed the max/min value.

Constructors

Link copied to clipboard
constructor(number: Long, unit: TimeUnit)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Converts the current TimeFrame to the give unit

Link copied to clipboard
open operator override fun compareTo(other: TimeFrame): Int
Link copied to clipboard

Converts the current TimeFrame to days

Link copied to clipboard

Converts the current TimeFrame to hours

Link copied to clipboard

Converts the current TimeFrame to milliseconds

Link copied to clipboard

Converts the current TimeFrame to minutes

Link copied to clipboard

Converts the current TimeFrame to seconds