public static String formatTimeDelta(long time,CharSequence sep){
  final StringBuilder sb=new StringBuilder();
  final Formatter fmt=new Formatter(sb);
  for (int i=TIME_UNIT_SIZES.length - 1; i >= 0; --i) {
    if (i == 0 && sb.length() > 4) {
      continue;
    }
    if (sb.length() > 0) {
      sb.append(sep);
    }
    final long acValue=time / TIME_UNIT_SIZES[i];
    time=time % TIME_UNIT_SIZES[i];
    if (!(acValue == 0 && sb.length() == 0)) {
      fmt.format("%0" + TIME_UNIT_DIGITS[i] + "d%s",Long.valueOf(acValue),TIME_UNIT_NAMES[i]);
    }
  }
  fmt.close();
  return sb.toString();
}

public static String formatTimeDelta ( long time , CharSequence sep ) { final StringBuilder sb = new StringBuilder ( ) ; final Formatter fmt = new Formatter ( sb ) ; for ( int i = TIME_UNIT_SIZES . length - 1 ; i >= 0 ; -- i ) { if ( i == 0 && sb . length ( ) > 4 ) { continue ; } if ( sb . length ( ) > 0 ) { sb . append ( sep ) ; } final long acValue = time / TIME_UNIT_SIZES [ i ] ; time = time % TIME_UNIT_SIZES [ i ] ; if ( ! ( acValue == 0 && sb . length ( ) == 0 ) ) { fmt . format ( "%0" + TIME_UNIT_DIGITS [ i ] + "d%s" , Long . valueOf ( acValue ) , TIME_UNIT_NAMES [ i ] ) ; } } fmt . close ( ) ; return sb . toString ( ) ; }
formats a time delta in human readable format .
