Changeset 132


Ignore:
Timestamp:
Mar 28, 2007, 3:41:10 AM (14 years ago)
Author:
alloc
Message:
 
Location:
oup/current
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • oup/current/Helper/LevelDB.pas

    r131 r132  
    6666  Stream_Dat, Stream_Raw, Stream_Sep: TFileStream;
    6767
    68 //  Data, rawdata: Tdata;
    6968  BeginTime, FileTime: Double;
    7069  Step:     Integer;
    71 //  rawlist:  TRawDataList;
    72 //  datlinks: TDatLinks;
    7370  OniImage:   TOniImage;
    7471  LevelID:    Integer;
     
    9188
    9289  DatFileStream, RawFileStream: TMemoryStream;
     90
     91// ###########################
     92  datsum, linksum, rawsum: Int64;
     93  freq: Int64;
     94  tempticks1, tempticks2: Int64;
     95// ###########################
    9396const
    9497  Steps: Byte = 3;
     
    281284  Application.ProcessMessages;
    282285
     286  QueryPerformanceFrequency(freq);
     287  datsum := 0;
     288  linksum := 0;
     289  rawsum := 0;
     290
    283291  FileTime := Time;
    284292  for FileID := 0 to DatHeader.Files - 1 do
     
    289297    if FileInfo.Size > 0 then
    290298    begin
     299      QueryPerformanceCounter(tempticks1);
     300
    291301      FilesHeader[FileID].DataAddr := Stream_Body.Size + 8;
    292302      DatFileStream := TMemoryStream.Create;
     
    294304      DatFileStream.Seek(4, soFromBeginning);
    295305      DatFileStream.Write(LevelID, 4);
     306
     307      QueryPerformanceCounter(tempticks2);
     308      datsum := datsum + (tempticks2 - tempticks1);
    296309
    297310      DatLinks := Connection.GetDatLinks(FileID);
     
    308321        end;
    309322      end;
     323
     324      QueryPerformanceCounter(tempticks1);
     325      linksum := linksum + (tempticks1 - tempticks2);
    310326
    311327      RawLinks := Connection.GetRawList(FileID);
     
    335351      DatFileStream.Seek(0, soFromBeginning);
    336352      Stream_Body.CopyFrom(DatFileStream, DatFileStream.Size);
     353
     354      QueryPerformanceCounter(tempticks2);
     355      rawsum := rawsum + (tempticks2 - tempticks1);
    337356    end
    338357    else
     
    356375    Application.ProcessMessages;
    357376  end;
     377
     378  ShowMessage('AvgDats: ' + FloatToStr((datsum / progress.Max) / freq) + #13#10 +
     379      'AvgLinks: ' + FloatToStr((linksum / progress.Max) / freq) + #13#10 +
     380      'AvgRaws: ' + FloatToStr((rawsum / progress.Max) / freq)
     381   );
    358382
    359383  Stream_Dat.Write(DatHeader, SizeOf(DatHeader));
Note: See TracChangeset for help on using the changeset viewer.