List of usage examples for org.apache.commons.lang3.time StopWatch unsplit
public void unsplit()
Remove a split.
From source file:org.sparkbit.jsonrpc.JSONRPCController.java
public boolean waitForTxSelectable(Transaction tx) { int n = jetty.sendAssetTimeout; if (n == 0)/* www .j a v a 2s. c o m*/ return true; // don't wait if timeout period is 0 final StopWatch stopwatch = new StopWatch(); stopwatch.start(); boolean timedOut = false; while (!DefaultCoinSelector.isSelectable(tx)) { try { Thread.sleep(WAIT_FOR_TX_SELECTABLE_SLEEP_INTERVAL); } catch (InterruptedException e) { } stopwatch.split(); long elapsed = stopwatch.getSplitTime(); stopwatch.unsplit(); // log.debug("elapsed = " + elapsed); if (elapsed > n) { timedOut = true; log.debug("Waiting in loop to be selectable timed out for txid " + tx.getHashAsString()); break; // timed out waiting for tx to be selectable } } stopwatch.stop(); if (!timedOut) { log.debug("Waiting in loop to be selectable took " + stopwatch + " for txid " + tx.getHashAsString() + " and broadcast count is " + tx.getConfidence().getBroadcastByCount()); } return true; }