public void run() { long end, gap = 1000 * monitoringInterval; long start = System.currentTimeMillis(); try { Thread.sleep(gap); // wait xx seconds } catch (InterruptedException e) { e.printStackTrace(); } while (isRunning) { try { // print the current status: end = System.currentTimeMillis() - start; System.out.printf("Analyzed %d images in %s ~ %3.2f ms each. (queue size is %d)\n", overallCount, StatsUtils.convertTime(end), ((overallCount > 0) ? ((float) end / (float) overallCount) : -1f), queue.size()); Thread.sleep(gap); // wait xx seconds } catch (InterruptedException e) { e.printStackTrace(); } } }
public void run() { long end, gap = 1000 * monitoringInterval; long start = System.currentTimeMillis(); try { Thread.sleep(gap); // wait xx seconds } catch (InterruptedException e) { e.printStackTrace(); } while (isRunning) { try { // print the current status: end = System.currentTimeMillis() - start; System.out.printf("Analyzed %d images in %s ~ %3.2f ms each. (queue size is %d)\n", overallCount, StatsUtils.convertTime(end), ((overallCount > 0) ? ((float) end / (float) overallCount) : -1f), queue.size()); Thread.sleep(gap); // wait xx seconds } catch (InterruptedException e) { e.printStackTrace(); } } }
count++; if (count%1000==0) { System.out.printf("Processed %d images took %s minutes, ~%.2f ms per image.\n", (int) count, StatsUtils.convertTime(sw.getTimeSinceStart()), (double) sw.getTimeSinceStart()/count); System.out.printf("\nIt's finished. Processing %d images took %s minutes, ~%.2f ms per image.\n", (int) count, StatsUtils.convertTime(sw.getTime()), (double) sw.getTime()/count); } catch (FileNotFoundException e) { e.printStackTrace();
count++; if (count%1000==0) { System.out.printf("Processed %d images took %s minutes, ~%.2f ms per image.\n", (int) count, StatsUtils.convertTime(sw.getTimeSinceStart()), (double) sw.getTimeSinceStart()/count); System.out.printf("\nIt's finished. Processing %d images took %s minutes, ~%.2f ms per image.\n", (int) count, StatsUtils.convertTime(sw.getTime()), (double) sw.getTime()/count); } catch (FileNotFoundException e) { e.printStackTrace();