From: Sasa M. <sa...@us...> - 2004-11-08 14:01:50
|
Update of /cvsroot/jrobin/src/org/jrobin/convertor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15540/org/jrobin/convertor Modified Files: Convertor.java Log Message: Minor cosmetical improvements Index: Convertor.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/convertor/Convertor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Convertor.java 5 Nov 2004 13:10:19 -0000 1.4 --- Convertor.java 8 Nov 2004 14:01:36 -0000 1.5 *************** *** 29,37 **** import java.io.*; import java.text.DecimalFormat; class Convertor { private static final String SUFFIX = ".jrb"; private static final DecimalFormat secondsFormatter = new DecimalFormat("##0.000"); ! private static final DecimalFormat countFormatter = new DecimalFormat("00000"); private String[] files; --- 29,38 ---- import java.io.*; import java.text.DecimalFormat; + import java.util.Date; class Convertor { private static final String SUFFIX = ".jrb"; private static final DecimalFormat secondsFormatter = new DecimalFormat("##0.000"); ! private static final DecimalFormat countFormatter = new DecimalFormat("0000"); private String[] files; *************** *** 43,46 **** --- 44,48 ---- private void convertAll() { + Date t1 = new Date(); final String ruler = "======================================================================="; println(ruler); *************** *** 54,58 **** println(ruler); println("Finished: " + totalCount + " total, " + ! goodCount + " OK, " + badCount + " failed."); } --- 56,67 ---- println(ruler); println("Finished: " + totalCount + " total, " + ! goodCount + " OK, " + badCount + " failed"); ! Date t2 = new Date(); ! double secs = (t2.getTime() - t1.getTime()) / 1000.0; ! println("Conversion took " + secondsFormatter.format(secs) + " sec"); ! if(totalCount > 0) { ! double avgSec = secs / totalCount; ! println("Average per-file conversion time: " + secondsFormatter.format(avgSec) + " sec"); ! } } *************** *** 62,66 **** try { File rrdFile = new File(path); ! print(countFormatter.format(totalCount) + " " + rrdFile.getName() + " "); String sourcePath = rrdFile.getCanonicalPath(); String destPath = sourcePath + SUFFIX; --- 71,76 ---- try { File rrdFile = new File(path); ! print(countFormatter.format(totalCount) + "/" + countFormatter.format(files.length) + ! " " + rrdFile.getName() + " "); String sourcePath = rrdFile.getCanonicalPath(); String destPath = sourcePath + SUFFIX; |