toComponents
inline fun <T> toComponents(
action: (days: Int, hours: Int, minutes: Int, seconds: Int, nanoseconds: Int) -> T
): TSplits this duration into days, hours, minutes, seconds, and nanoseconds and executes the given action with these components. The result of action is returned as the result of this function.
nanosecondsrepresents the whole number of nanoseconds in this duration, and its absolute value is less than 1_000_000_000;secondsrepresents the whole number of seconds in this duration, and its absolute value is less than 60;minutesrepresents the whole number of minutes in this duration, and its absolute value is less than 60;hoursrepresents the whole number of hours in this duration, and its absolute value is less than 24;daysrepresents the whole number of days in this duration. If the value doesn't fit in Int range, i.e. it's greater than Int.MAX_VALUE or less than Int.MIN_VALUE, it is coerced into that range.
inline fun <T> toComponents(
action: (hours: Int, minutes: Int, seconds: Int, nanoseconds: Int) -> T
): TSplits this duration into hours, minutes, seconds, and nanoseconds and executes the given action with these components. The result of action is returned as the result of this function.
nanosecondsrepresents the whole number of nanoseconds in this duration, and its absolute value is less than 1_000_000_000;secondsrepresents the whole number of seconds in this duration, and its absolute value is less than 60;minutesrepresents the whole number of minutes in this duration, and its absolute value is less than 60;hoursrepresents the whole number of hours in this duration. If the value doesn't fit in Int range, i.e. it's greater than Int.MAX_VALUE or less than Int.MIN_VALUE, it is coerced into that range.
Splits this duration into minutes, seconds, and nanoseconds and executes the given action with these components. The result of action is returned as the result of this function.
nanosecondsrepresents the whole number of nanoseconds in this duration, and its absolute value is less than 1_000_000_000;secondsrepresents the whole number of seconds in this duration, and its absolute value is less than 60;minutesrepresents the whole number of minutes in this duration. If the value doesn't fit in Int range, i.e. it's greater than Int.MAX_VALUE or less than Int.MIN_VALUE, it is coerced into that range.
Splits this duration into seconds, and nanoseconds and executes the given action with these components. The result of action is returned as the result of this function.
nanosecondsrepresents the whole number of nanoseconds in this duration, and its absolute value is less than 1_000_000_000;secondsrepresents the whole number of seconds in this duration. If the value doesn't fit in Long range, i.e. it's greater than Long.MAX_VALUE or less than Long.MIN_VALUE, it is coerced into that range.