Changeset 142 for oup


Ignore:
Timestamp:
Mar 30, 2007, 4:08:49 AM (18 years ago)
Author:
alloc
Message:
 
Location:
oup/current
Files:
2 edited

Legend:

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

    r141 r142  
    7575
    7676  DatFileStream, RawFileStream: TMemoryStream;
    77 
    78 // ###########################
    79   datsum, linksum, rawsum: Int64;
    80   freq: Int64;
    81   tempticks1, tempticks2: Int64;
    82 // ###########################
    8377const
    8478  Steps: Byte = 3;
     
    298292  Application.ProcessMessages;
    299293
    300   QueryPerformanceFrequency(freq);
    301   datsum := 0;
    302   linksum := 0;
    303   rawsum := 0;
    304 
    305294  FileTime := Time;
    306295  for FileID := 0 to DatHeader.Files - 1 do
     
    311300    if FileInfo.Size > 0 then
    312301    begin
    313       QueryPerformanceCounter(tempticks1);
    314 
    315302      FilesHeader[FileID].DataAddr := Stream_Body.Size + 8;
    316303      DatFileStream := TMemoryStream.Create;
     
    320307      DatFileStream.Write(tempi, 4);
    321308      DatFileStream.Write(LevelID, 4);
    322 
    323       QueryPerformanceCounter(tempticks2);
    324       datsum := datsum + (tempticks2 - tempticks1);
    325309
    326310      DatLinks := Connection.GetDatLinks(FileID);
     
    337321        end;
    338322      end;
    339 
    340       QueryPerformanceCounter(tempticks1);
    341       linksum := linksum + (tempticks1 - tempticks2);
    342323
    343324      RawLinks := Connection.GetRawList(FileID);
     
    367348      DatFileStream.Seek(0, soFromBeginning);
    368349      Stream_Body.CopyFrom(DatFileStream, DatFileStream.Size);
    369 
    370       QueryPerformanceCounter(tempticks2);
    371       rawsum := rawsum + (tempticks2 - tempticks1);
    372350    end
    373351    else
     
    392370  end;
    393371
    394   ShowMessage('AvgDats: ' + FloatToStr((datsum / progress.Max) / freq) + #13#10 +
    395       'AvgLinks: ' + FloatToStr((linksum / progress.Max) / freq) + #13#10 +
    396       'AvgRaws: ' + FloatToStr((rawsum / progress.Max) / freq)
    397    );
    398 
    399372  Stream_Dat.Write(DatHeader, SizeOf(DatHeader));
    400373  for i := 0 to High(FilesHeader) do
     
    451424  BeginTime, FileTime: Double;
    452425  Step:       Integer;
    453   LevelID:    Integer;
    454426  TimeFormat: TFormatSettings;
    455427
     
    460432  FileID:     Integer;
    461433
    462   Strings:    TStrings;
    463434  i:          Integer;
    464435  temps:      String;
    465   tempi:      Integer;
    466   tempb:      Byte;
    467436  tempdata:   TByteData;
    468437  FileInfo:   TFileInfo;
     
    636605  Application.ProcessMessages;
    637606
     607  FileTime := Time;
    638608  Database.StartTransaction;
    639609  for FileID := 0 to Connection.GetFileCount - 1 do
     
    710680    if ((FileID mod 10) = 0) and (FileID >= 100) then
    711681      lbl_estimation.Caption := 'Estimated time left: ' + TimeToStr(
    712         (Time - BeginTime) / FileID * (progress.Max - FileID + 1) * 1.1, timeformat );
     682        (Time - FileTime) / FileID * (progress.Max - FileID + 1) * 1.1, timeformat );
    713683    progress.Position := FileID;
    714684    lbl_progress.Caption := 'Files done: ' + IntToStr(FileID) + '/' + IntToStr(progress.Max);
Note: See TracChangeset for help on using the changeset viewer.