Changeset 2700


Ignore:
Timestamp:
04/27/07 13:25:57 (13 years ago)
Author:
curtis
Message:

Clean up timing results for testRead and testConvert.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/FormatTools.java

    r2699 r2700  
    248248    reader.setMetadataFiltered(true); 
    249249    reader.setMetadataCollected(doMeta); 
     250    long s1 = System.currentTimeMillis(); 
    250251    reader.setId(id); 
    251     if (minMaxCalc != null) minMaxCalc.setId(id); 
     252    long e1 = System.currentTimeMillis(); 
     253    float sec1 = (e1 - s1) / 1000f; 
     254    System.out.println("Initialization took " + sec1 + "s"); 
    252255 
    253256    if (!normalize && reader.getPixelType() == FLOAT) { 
     
    407410      System.out.print("Reading" + s + " pixel data "); 
    408411      status.setVerbose(false); 
    409       long s1 = System.currentTimeMillis(); 
    410412      int num = reader.getImageCount(); 
    411413      if (start < 0) start = 0; 
     
    416418 
    417419      System.out.print("(" + start + "-" + end + ") "); 
    418       long e1 = System.currentTimeMillis(); 
    419420      BufferedImage[] images = new BufferedImage[end - start + 1]; 
    420421      long s2 = System.currentTimeMillis(); 
     
    460461 
    461462      // output timing results 
    462       float sec = (e2 - s1) / 1000f; 
     463      float sec2 = (e2 - s2) / 1000f; 
    463464      float avg = (float) (e2 - s2) / images.length; 
    464       long initial = e1 - s1; 
    465       System.out.println(sec + "s elapsed (" + 
    466         avg + "ms per image, " + initial + "ms overhead)"); 
     465      System.out.println(sec2 + "s elapsed (" + avg + "ms per image)"); 
    467466 
    468467      if (minmax) { 
     
    617616    } 
    618617 
     618 
     619    long start = System.currentTimeMillis(); 
     620    System.out.print(in + " "); 
    619621    ImageReader reader = new ImageReader(); 
    620622    reader.setId(in); 
     623    System.out.print("[" + reader.getFormat() + "] -> " + out + " "); 
    621624    writer.setId(out); 
    622  
    623     // check file formats 
    624     System.out.print("Input format: "); 
    625     System.out.println("[" + reader.getFormat() + "]"); 
    626     System.out.print("Output format: "); 
    627     System.out.println("[" + writer.getFormat() + "]"); 
    628  
    629     // convert file 
    630     System.out.print(in + " -> " + out + " "); 
    631  
    632     long start = System.currentTimeMillis(); 
     625    System.out.print("[" + writer.getFormat() + "] "); 
     626    long mid = System.currentTimeMillis(); 
     627 
    633628    int num = writer.canDoStacks() ? reader.getImageCount() : 1; 
    634     long mid = System.currentTimeMillis(); 
    635629    long read = 0, write = 0; 
    636630    for (int i=0; i<num; i++) { 
Note: See TracChangeset for help on using the changeset viewer.