longestDuration

fun longestDuration(firstInSeconds: Long, secondInSeconds: Long?): Duration(source)

Nomen est omen; takes two durations in seconds (with the second one nullable) and returns the shorter one as Duration