code: private static String time2Str(long elapsedTime) {
      String unit;
      double time = elapsedTime;
      if (elapsedTime < 1000) {
        unit = "milliseconds";
      } else if (elapsedTime < 60*1000) {
        unit = "seconds";
        time = time/1000;
      } else if (elapsedTime < 3600*1000) {
        unit = "minutes";
        time = time/(60*1000);
      } else {
        unit = "hours";
        time = time/(3600*1000);
      }
  
      return time+" "+unit;
    }
docs: /* Given elaspedTime in ms, return a printable string