code: public static String asTime(long time) {
          if (time > HOUR) {
              return String.format("%.1f h", (time / HOUR));
          } else if (time > MINUTE) {
              return String.format("%.1f m", (time / MINUTE));
          } else if (time > SECOND) {
              return String.format("%.1f s", (time / SECOND));
          } else {
              return String.format("%d ms", time);
          }
      }
docs: Renders a time period in human readable form
  
  @param time the time in milliseconds
  @return the time in human readable form