package com.gh.gamecenter.feature.exposure.time

import com.therouter.TheRouter
import com.gh.gamecenter.core.provider.IFixedRateJobHelperProvider

object TimeUtil {

    fun currentTimeMillis(): Long {
        val provider = TheRouter.get(IFixedRateJobHelperProvider::class.java)
        return (provider?.getTimeDeltaBetweenServerAndClient() ?: 0) + System.currentTimeMillis()
    }

    fun currentTime(): Int {
        val provider = TheRouter.get(IFixedRateJobHelperProvider::class.java)
        return (((provider?.getTimeDeltaBetweenServerAndClient() ?: 0) + System.currentTimeMillis()) / 1000).toInt()
    }

}