better duration formatting, promote to top-level util