public static String toHeaderValue(long timeoutNanos) {
        final long cutoff = 100000000;
        if (timeoutNanos < 0) {
            throw new IllegalArgumentException("Timeout too small");
        } else if (timeoutNanos < cutoff) {
            return TimeUnit.NANOSECONDS.toNanos(timeoutNanos) + "n";
        } else if (timeoutNanos < cutoff * 1000L) {
            return TimeUnit.NANOSECONDS.toMicros(timeoutNanos) + "u";
        } else if (timeoutNanos < cutoff * 1000L * 1000L) {
            return TimeUnit.NANOSECONDS.toMillis(timeoutNanos) + "m";
        } else if (timeoutNanos < cutoff * 1000L * 1000L * 1000L) {
            return TimeUnit.NANOSECONDS.toSeconds(timeoutNanos) + "S";
        } else if (timeoutNanos < cutoff * 1000L * 1000L * 1000L * 60L) {
            return TimeUnit.NANOSECONDS.toMinutes(timeoutNanos) + "M";
        } else {
            return TimeUnit.NANOSECONDS.toHours(timeoutNanos) + "H";
        }
    }
Serialize the given timeout to a {@link String}.
grpc/src/main/java/com/linecorp/armeria/internal/common/grpc/TimeoutHeaderUtil.java