toTimeString

fun Duration.toTimeString(components: Int = 3, addMilliseconds: Boolean = false): String

Formats this TimeSpan into something like 12:30:40.100.

For 3 hour, 20 minutes and 15 seconds

1 components (seconds): 12015 2 components (minutes): 200:15 3 components (hours) : 03:20:15 4 components (days) : 00:03:20:15

With milliseconds would add decimals to the seconds part.