// =====================================================================
//  $Id: ifilebench.cc,v 1.2 2003/12/08 04:26:30 goiwai Exp $
//  $Name: CLDAQ-1-14-06 $
//  $Log: ifilebench.cc,v $
//  Revision 1.2  2003/12/08 04:26:30  goiwai
//  *** empty log message ***
//
//  Revision 1.1  2003/12/07 06:20:22  goiwai
//  ベンチーマーク用プログラムを追加しました.
//  測定をなるべく厳密に行なえるようにtest以下のプログラムを若干修整したも
//  のです.
//
// =====================================================================
#include "TDataRecord.hh"
#include "TInputObjectFile.hh"
#include "TBenchmark.hh"
#include "TFileProperty.hh"
#include "constants.h"

int main()
{
  TDataRecord record;

  for ( Tint i = 0; i < len; i ++ ) {
    Tint max = nevent[i];
    Tstring filename = "ofilebench" + itostr(max,0) + ".drec";
    TBenchmark bench;

    bench.Start();
    TInputObjectFile* ifile = new TInputObjectFile(filename);
    while ( ifile -> Read( record ) ) {
      // nothig to do;
    }
    delete ifile;
    bench.Stop();

    TFileProperty p(filename);
    Tcout << max << " "
          << p.GetTotalSize() << " "
          << bench.GetSystemTimer().GetRealElapsedTime() << Tendl;
  }

  return 0;
}
