Skip to content

Commit

Permalink
修复BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
杜琨 committed Aug 31, 2019
1 parent d6e9d65 commit 910c829
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;

import static java.lang.Math.min;

/**
* 高性能文本输出
* 高性能背后的代价就是相对比较高的CPU开销
Expand Down Expand Up @@ -110,15 +112,13 @@ private long computeDelayTimeMs() {
return delayTimeMs;
} else {
final long newDelayTime = delayTimeMs + delayStepTimeMs;
delayTimeMs = newDelayTime < delayMaxTimeMs
? newDelayTime
: delayMaxTimeMs;
delayTimeMs = min(newDelayTime, delayMaxTimeMs);
return delayTimeMs;
}
}

private long resetDelayTimeMs() {
return delayTimeMs = delayStepTimeMs;
private void resetDelayTimeMs() {
delayTimeMs = delayStepTimeMs;
}

private void delay() throws InterruptedException {
Expand Down

0 comments on commit 910c829

Please sign in to comment.