public synchronized boolean record(final String chrom, final int pos) { if (this.lastStartTime == -1) this.lastStartTime = System.currentTimeMillis(); if (++this.processed % this.n == 0) { final long now = System.currentTimeMillis(); final long lastPeriodSeconds = (now - this.lastStartTime) / 1000; this.lastStartTime = now; final long seconds = (System.currentTimeMillis() - startTime) / 1000; final String elapsed = formatElapseTime(seconds); final String period = pad(fmt.format(lastPeriodSeconds), 4); final String processed = pad(fmt.format(this.processed), 13); final String readInfo; if (chrom == null) readInfo = "*/*"; else readInfo = chrom + ":" + fmt.format(pos); log.info(this.verb, " ", processed, " " + noun + ". Elapsed time: ", elapsed, "s. Time for last ", fmt.format(this.n), ": ", period, "s. Last read position: ", readInfo); return true; } else { return false; } }