instacart / truetime-android

Android NTP time library. Get the true current time impervious to device clock time changes
https://tech.instacart.com/truetime/
Apache License 2.0
1.42k stars 193 forks source link

Duration support #151

Closed Jawnnypoo closed 1 year ago

Jawnnypoo commented 1 year ago

Kotlin has Duration, which is nice because you can specify in .milliseconds, .hours, or whatever else you like. So, this would be a nice way of allowing users to not have to convert everything to milliseconds if they wanted to use seconds or minutes.

Internally, within Sntp, it will still use milliseconds, since I don't think we want to deal with the interop of using Kotlin duration within Java 😅

kaushikgopal commented 1 year ago

@Jawnnypoo i think the spotless checks are failing 😎 . glad that's working. let me push a small commit up and see if i can get this passing again.

kaushikgopal commented 1 year ago

This change makes sense to me. it feels fair to push to a newer construct/object when configuring TrueTime. In #150 where we're moving away from Date for the basic apis... makes me a little nervous.