timer.schedule(object : TimerTask() { override fun run() { CoroutineScope(Dispatchers.Main).launch{ //TODO:your code } } },1000,1000)