See gh-27149
@ -183,7 +183,7 @@ public enum DurationStyle {
/**
* Microseconds.
*/
MICROS(ChronoUnit.MICROS, "us", (duration) -> duration.toMillis() * 1000L),
MICROS(ChronoUnit.MICROS, "us", duration -> duration.toNanos() / 1000L),
* Milliseconds.
@ -234,6 +234,7 @@ class DurationStyleTests {
void printSimpleWithUnitShouldPrintInUnit() {
Duration duration = Duration.ofMillis(1000);
assertThat(DurationStyle.SIMPLE.print(duration, ChronoUnit.SECONDS)).isEqualTo("1s");
assertThat(DurationStyle.SIMPLE.print(Duration.ofNanos(2000), ChronoUnit.MICROS)).isEqualTo("2us");
}