To start a repeated job you may use `Timer`: ``` ...
# getting-started
o
To start a repeated job you may use `Timer`:
Copy code
val timer = Timer().also {
            it.scheduleAtFixedRate(0, 1000) {
                val hours = seconds / 3600
                val minutes = (seconds % 3600) / 60
                val secs = (seconds % 60)
                timeView.text = String.format(Locale.getDefault(), "%d:%02d:%02d", hours, minutes, secs)
                seconds++
            }
        }
And to stop instead (instead of using a weird boolean):
Copy code
timer.cancel()