code: public static String toTimePrecision(final TimeUnit t) {
          switch (t) {
              case HOURS:
                  return "h";
              case MINUTES:
                  return "m";
              case SECONDS:
                  return "s";
              case MILLISECONDS:
                  return "ms";
              case MICROSECONDS:
                  return "u";
              case NANOSECONDS:
                  return "n";
              default:
                  EnumSet<TimeUnit> allowedTimeunits = EnumSet.of(
                          TimeUnit.HOURS,
                          TimeUnit.MINUTES,
                          TimeUnit.SECONDS,
                          TimeUnit.MILLISECONDS,
                          TimeUnit.MICROSECONDS,
                          TimeUnit.NANOSECONDS);
                  throw new IllegalArgumentException("time precision must be one of:" + allowedTimeunits);
          }
      }
docs: Convert from a TimeUnit to a influxDB timeunit String.
  
  @param t time unit
  @return the String representation.