반응형

간단한 타이머 기능

    /**
     * music timer
     */
    var mTimer: Timer?= null
    fun runTimer(){
        if (mTimer == null){
            mTimer = timer(period = 600){
                currentDuration()
            }
        }
    }
    fun stopTimer(){
        mTimer?.let {
            it.cancel()
        }
        mTimer = null
    }
반응형

+ Recent posts