ylliX - Online Advertising Network

Type-safe time calculations using Duration

Time calculations have always been a sensitive topic in most programming languages. Kotlin is no exception. If we have a function which accepts a time value to calculate a duration, it’s challenging to enforce a proper unit that the caller must follow. Starting from Kotlin 1.3.50, we can now make use of the Duration class […]