All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gojek.courier.extensions.TimeUnitExtensions.kt Maven / Gradle / Ivy

There is a newer version: 0.3.1
Show newest version
package com.gojek.courier.extensions

import androidx.annotation.RestrictTo
import java.util.concurrent.TimeUnit

@RestrictTo(RestrictTo.Scope.LIBRARY)
fun Long.fromNanosToMillis(): Long = TimeUnit.NANOSECONDS.toMillis(this)

@RestrictTo(RestrictTo.Scope.LIBRARY)
fun Long.fromSecondsToNanos(): Long = TimeUnit.SECONDS.toNanos(this)

@RestrictTo(RestrictTo.Scope.LIBRARY)
fun Long.fromMinutesToSeconds() = TimeUnit.MINUTES.toSeconds(this)

@RestrictTo(RestrictTo.Scope.LIBRARY)
fun Long.fromMinutesToMillis() = TimeUnit.MINUTES.toMillis(this)

@RestrictTo(RestrictTo.Scope.LIBRARY)
fun Int.fromMinutesToSeconds() = this.toLong().fromMinutesToSeconds()

@RestrictTo(RestrictTo.Scope.LIBRARY)
fun Int.fromMinutesToMillis() = this.toLong().fromMinutesToMillis()

@RestrictTo(RestrictTo.Scope.LIBRARY)
fun Long.fromMillisToSeconds() = TimeUnit.MILLISECONDS.toSeconds(this)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy