Skip to content

Commit

Permalink
Pretty-print elapsed time rather than use millis
Browse files Browse the repository at this point in the history
  • Loading branch information
maniksurtani committed Jan 21, 2012
1 parent f420eff commit c6350a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Expand Up @@ -172,8 +172,7 @@ public void preload() {

if (debugTiming) {
final long stop = System.nanoTime();
final long elapsedMillis = TimeUnit.NANOSECONDS.convert(stop -start, TimeUnit.NANOSECONDS);
log.debugf("Preloaded %s keys in %s milliseconds", state.size(), elapsedMillis);
log.debugf("Preloaded %s keys in %s", state.size(), Util.prettyPrintTime(stop - start, TimeUnit.NANOSECONDS));
}
}
}
Expand Down
Expand Up @@ -444,7 +444,7 @@ private boolean areTxsOnGoing() {

private void shutDownGracefully() {
if (log.isDebugEnabled())
log.debugf("Wait for on-going transactions to finish for %d seconds.", TimeUnit.MILLISECONDS.toSeconds(configuration.getCacheStopTimeout()));
log.debugf("Wait for on-going transactions to finish for %s.", Util.prettyPrintTime(configuration.getCacheStopTimeout(), TimeUnit.MILLISECONDS));
long failTime = currentMillisFromNanotime() + configuration.getCacheStopTimeout();
boolean txsOnGoing = areTxsOnGoing();
while (txsOnGoing && currentMillisFromNanotime() < failTime) {
Expand Down

0 comments on commit c6350a6

Please sign in to comment.