Skip to content

Commit

Permalink
Change notation
Browse files Browse the repository at this point in the history
  • Loading branch information
ethlo committed Aug 15, 2019
1 parent 3b1c008 commit a259ad8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ Output:
--------------------------------------------------------------------------------
| Task | Average | Total | Invocations | % |
--------------------------------------------------------------------------------
| a long task name | 1.18 μ | 118.06 ms | 100,000 | 33.4% |
| bar ba | 1.18 μ | 117.64 ms | 100,000 | 33.2% |
| baz baz baz baz baz b | 1.18 μ | 118.28 ms | 100,000 | 33.4% |
| a long task name | 1.18 μs | 118.06 ms | 100,000 | 33.4% |
| bar ba | 1.18 μs | 117.64 ms | 100,000 | 33.2% |
| baz baz baz baz baz b | 1.18 μs | 118.28 ms | 100,000 | 33.4% |
--------------------------------------------------------------------------------
| Total: 353.98m |
--------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/ethlo/time/DurationUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ else if (hasSecondOrMore)

if (millis == 0 && micros > 0)
{
sb.append(df.format(nanos / (double) NANOS_PER_MICRO)).append(" μ ");
sb.append(df.format(nanos / (double) NANOS_PER_MICRO)).append(" μs ");
}

if (millis == 0 && micros == 0 && nano > 0)
{
sb.append(nano).append(" n ");
sb.append(nano).append(" ns ");
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/ethlo/time/DurationUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ public void humanReadableFormatLessThanSecond()
@Test
public void humanReadableFormatLessThanMillisecond()
{
assertThat(DurationUtil.humanReadable(Duration.ofNanos(456_789))).isEqualTo("456.79 μ");
assertThat(DurationUtil.humanReadable(Duration.ofNanos(456_789))).isEqualTo("456.79 μs");
}

@Test
public void humanReadableFormatLessThanMicrosecond()
{
assertThat(DurationUtil.humanReadable(Duration.ofNanos(489))).isEqualTo("489 n");
assertThat(DurationUtil.humanReadable(Duration.ofNanos(489))).isEqualTo("489 ns");
}
}

0 comments on commit a259ad8

Please sign in to comment.