Skip to content

Commit

Permalink
Log.Time: bug fixed: getDuration always returns 0 as it compares …
Browse files Browse the repository at this point in the history
…to itself.
  • Loading branch information
ATATC committed Aug 23, 2023
1 parent 16a753c commit b22856e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/atatctech/packages/log/Log.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public long getDuration(@NotNull Unit unit) {
}

public long getDuration() {
return getDuration(this);
return getDuration(new Time());
}

public @NotNull Milliseconds getDurationAsGap() {
Expand All @@ -156,7 +156,7 @@ public long getDuration(@NotNull Time time, @NotNull Unit unit) {
}

public long getDuration(@NotNull Time time) {
return Math.abs(time.getBaseTime() - getBaseTime());
return calculateDuration(this, time);
}

public @NotNull TimePeriod getDurationAsGap(@NotNull Time time, @NotNull Unit unit) {
Expand Down

0 comments on commit b22856e

Please sign in to comment.