Android
1
Вклад в тег
object ServerTime {
private var serverOffset: Long = System.currentTimeMillis() - SystemClock.elapsedRealtime()
fun getTime(): Long = SystemClock.elapsedRealtime() + serverOffset
fun syncTime(serverTime: Long) {
serverOffset = serverTime - SystemClock.elapsedRealtime()
}
}