public void stopAndTrace(String label) { stop(); trace(label); }
addedVariableBands, ProgressMonitor.NULL); stopWatch.stop();
private TemporalBinList doTemporalBinning(SpatialBinCollection spatialBinMap) throws IOException { StopWatch stopWatch = new StopWatch(); stopWatch.start(); long numberOfBins = spatialBinMap.size(); final TemporalBinner temporalBinner = new TemporalBinner(binningContext); final CellProcessorChain cellChain = new CellProcessorChain(binningContext); final TemporalBinList temporalBins = new TemporalBinList((int) numberOfBins); Iterable<List<SpatialBin>> spatialBinListCollection = spatialBinMap.getBinCollection(); int binCounter = 0; int percentCounter = 0; long hundredthOfNumBins = numberOfBins / 100; for (List<SpatialBin> spatialBinList : spatialBinListCollection) { binCounter += spatialBinList.size(); SpatialBin spatialBin = spatialBinList.get(0); long spatialBinIndex = spatialBin.getIndex(); TemporalBin temporalBin = temporalBinner.processSpatialBins(spatialBinIndex, spatialBinList); temporalBin = temporalBinner.computeOutput(spatialBinIndex, temporalBin); temporalBin = cellChain.process(temporalBin); temporalBins.add(temporalBin); if (binCounter >= hundredthOfNumBins) { binCounter = 0; getLogger().info(String.format("Finished %d%% of temporal bins", ++percentCounter)); } } stopWatch.stop(); getLogger().info(String.format("Temporal binning of %d bins done, took %s", numberOfBins, stopWatch)); return temporalBins; }
/** * Tests the functionality of toString() */ public void testToString() { StopWatch watch = new StopWatch(); try { Thread.sleep(10); } catch (InterruptedException e) { } watch.stop(); assertEquals(watch.getTimeDiffString(), watch.toString()); } }
/** * Tests the functionality of getTimeDiffString() */ public void testGetTimeDiffString() { StopWatch watch = new StopWatch(); watch.stop(); // just check that we don't get an empty string assertTrue("" != watch.getTimeDiffString()); }
stopTime, processingGraphMetadata); stopWatch.stop();
/** * Tests the functionality for getEndTime */ public void testGetEndTime() { StopWatch watch = new StopWatch(); long endTime; try { Thread.sleep(10); } catch (InterruptedException e) { } // check if stop time is different from start watch.stop(); endTime = watch.getEndTime(); assertTrue(0 != endTime); // check if end time now is the same (we haven't started the timer agaiin assertEquals(endTime, watch.getEndTime()); }
/** * Tests the functionality of getTimeDiff */ public void testGetTimeDiff() { StopWatch watch = new StopWatch(); long startTime; long endTime; startTime = watch.getStartTime(); watch.stop(); endTime = watch.getEndTime(); assertEquals(endTime - startTime, watch.getTimeDiff()); }
product, sliceRectangles[idx]); final String label = String.format("Processed slice %d of %d : ", idx + 1, sliceRectangles.length); stopWatch.stop(); logger.info(label + stopWatch.getTimeDiffString());