code: private static String getDuration(long millis) {
          long tsec = millis / 1000;
          long h = tsec / 60 / 60;
          long m = (tsec - h * 60 * 60) / 60;
          long s = tsec - h * 60 * 60 - m * 60;
          StringBuffer out = new StringBuffer();
          if (h > 0) {
              out.append(h + " hour");
              if (h > 1) {
                  out.append('s');
              }
          }
          if (m > 0) {
              if (h > 0) {
                  out.append(", ");
              }
              out.append(m + " minute");
              if (m > 1) {
                  out.append('s');
              }
          }
          if (s > 0 || h == 0 && m == 0) {
              if (h > 0 || m > 0) {
                  out.append(", ");
              }
              out.append(s + " second");
              if (s != 1) {
                  out.append('s');
              }
          }
          return out.toString();
      }
docs: Convert the duration time from milliseconds to standard hours, minutes,
  and seconds format.
  
  @param millis
  The time interval to convert in miliseconds.
  @return A string with the converted time.