static public String formatMillis(long millis){
  boolean isMinutes=false;
  double instTime=millis;
  String suffix="milliseconds";
  if (instTime > (60 * 1000)) {
    suffix="minutes";
    instTime=instTime / (60 * 1000);
    isMinutes=true;
  }
 else   if (instTime > 1000) {
    suffix="seconds";
    instTime=instTime / 1000;
  }
  if (!isMinutes) {
    NumberFormat nf=NumberFormat.getInstance();
    nf.setMaximumFractionDigits(2);
    return nf.format(instTime) + " " + suffix;
  }
  int minutes=(int)instTime;
  double seconds=(instTime - minutes) * 60;
  NumberFormat nf=NumberFormat.getInstance();
  nf.setMaximumFractionDigits(2);
  nf.setMinimumIntegerDigits(2);
  return minutes + ":" + nf.format(seconds)+ " "+ suffix;
}

static public String formatMillis ( long millis ) { boolean isMinutes = false ; double instTime = millis ; String suffix = "milliseconds" ; if ( instTime > ( 60 * 1000 ) ) { suffix = "minutes" ; instTime = instTime / ( 60 * 1000 ) ; isMinutes = true ; } else if ( instTime > 1000 ) { suffix = "seconds" ; instTime = instTime / 1000 ; } if ( ! isMinutes ) { NumberFormat nf = NumberFormat . getInstance ( ) ; nf . setMaximumFractionDigits ( 2 ) ; return nf . format ( instTime ) + " " + suffix ; } int minutes = ( int ) instTime ; double seconds = ( instTime - minutes ) * 60 ; NumberFormat nf = NumberFormat . getInstance ( ) ; nf . setMaximumFractionDigits ( 2 ) ; nf . setMinimumIntegerDigits ( 2 ) ; return minutes + ":" + nf . format ( seconds ) + " " + suffix ; }
format ms interval to min / sec / ms
