Here you can find the source of formatDuration(long elapsed)
static public String formatDuration(long elapsed)
//package com.java2s; //License from project: Open Source License import java.time.Duration; public class Main { static public String formatDuration(long elapsed) { return Duration.ofMillis(elapsed).toString(); }/*w ww .jav a2 s.c o m*/ }