Changeset 142
- Timestamp:
- Mar 30, 2007, 4:08:49 AM (18 years ago)
- Location:
- oup/current
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/Helper/LevelDB.pas
r141 r142 75 75 76 76 DatFileStream, RawFileStream: TMemoryStream; 77 78 // ###########################79 datsum, linksum, rawsum: Int64;80 freq: Int64;81 tempticks1, tempticks2: Int64;82 // ###########################83 77 const 84 78 Steps: Byte = 3; … … 298 292 Application.ProcessMessages; 299 293 300 QueryPerformanceFrequency(freq);301 datsum := 0;302 linksum := 0;303 rawsum := 0;304 305 294 FileTime := Time; 306 295 for FileID := 0 to DatHeader.Files - 1 do … … 311 300 if FileInfo.Size > 0 then 312 301 begin 313 QueryPerformanceCounter(tempticks1);314 315 302 FilesHeader[FileID].DataAddr := Stream_Body.Size + 8; 316 303 DatFileStream := TMemoryStream.Create; … … 320 307 DatFileStream.Write(tempi, 4); 321 308 DatFileStream.Write(LevelID, 4); 322 323 QueryPerformanceCounter(tempticks2);324 datsum := datsum + (tempticks2 - tempticks1);325 309 326 310 DatLinks := Connection.GetDatLinks(FileID); … … 337 321 end; 338 322 end; 339 340 QueryPerformanceCounter(tempticks1);341 linksum := linksum + (tempticks1 - tempticks2);342 323 343 324 RawLinks := Connection.GetRawList(FileID); … … 367 348 DatFileStream.Seek(0, soFromBeginning); 368 349 Stream_Body.CopyFrom(DatFileStream, DatFileStream.Size); 369 370 QueryPerformanceCounter(tempticks2);371 rawsum := rawsum + (tempticks2 - tempticks1);372 350 end 373 351 else … … 392 370 end; 393 371 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 399 372 Stream_Dat.Write(DatHeader, SizeOf(DatHeader)); 400 373 for i := 0 to High(FilesHeader) do … … 451 424 BeginTime, FileTime: Double; 452 425 Step: Integer; 453 LevelID: Integer;454 426 TimeFormat: TFormatSettings; 455 427 … … 460 432 FileID: Integer; 461 433 462 Strings: TStrings;463 434 i: Integer; 464 435 temps: String; 465 tempi: Integer;466 tempb: Byte;467 436 tempdata: TByteData; 468 437 FileInfo: TFileInfo; … … 636 605 Application.ProcessMessages; 637 606 607 FileTime := Time; 638 608 Database.StartTransaction; 639 609 for FileID := 0 to Connection.GetFileCount - 1 do … … 710 680 if ((FileID mod 10) = 0) and (FileID >= 100) then 711 681 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 ); 713 683 progress.Position := FileID; 714 684 lbl_progress.Caption := 'Files done: ' + IntToStr(FileID) + '/' + IntToStr(progress.Max);
Note:
See TracChangeset
for help on using the changeset viewer.