Ignore:
Timestamp:
Feb 1, 2012, 3:50:43 PM (12 years ago)
Author:
chronos
Message:
  • Added: In addition to measure frame data conversion, table show real step duration and FPS include Application.ProcessMessage which cause TImage to draw its data to form and show lower FPS for draw methods which use TImage Bitmap as target.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest/UMainForm.pas

    r318 r319  
    117117
    118118procedure TMainForm.ButtonSingleTestClick(Sender: TObject);
     119var
     120  StepStartTime: TDateTime;
    119121begin
    120122  try
     
    129131      Application.ProcessMessages;
    130132      repeat
     133        StepStartTime := NowPrecise;
    131134        DrawFrameTiming(TFastBitmap(Scenes[SceneIndex]));
    132135        SceneIndex := (SceneIndex + 1) mod Scenes.Count;
    133136        Application.ProcessMessages;
     137        StepDuration := NowPrecise - StepStartTime;
    134138      until not SingleTestActive;
    135139    end;
     
    146150  C: Integer;
    147151  StartTime: TDateTime;
     152  StepStartTime: TDateTime;
    148153begin
    149154  try
     
    158163      StartTime := NowPrecise;
    159164      repeat
     165        StepStartTime := NowPrecise;
    160166        DrawFrameTiming(TFastBitmap(Scenes[SceneIndex]));
    161167        SceneIndex := (SceneIndex + 1) mod Scenes.Count;
    162168        Application.ProcessMessages;
     169        StepDuration := NowPrecise - StepStartTime;
    163170      until ((NowPrecise - StartTime) > OneSecond * FloatSpinEdit1.Value) or not AllTestActive;
    164171    end;
     
    204211    if FrameDuration > 0 then
    205212      Item.SubItems.Add(FloatToStr(RoundTo(1 / (FrameDuration / OneSecond), -3)))
     213      else Item.SubItems.Add('0');
     214    Item.SubItems.Add(FloatToStr(RoundTo(StepDuration / OneMillisecond, -3)));
     215    if FrameDuration > 0 then
     216      Item.SubItems.Add(FloatToStr(RoundTo(1 / (StepDuration / OneSecond), -3)))
    206217      else Item.SubItems.Add('0');
    207218  end;
Note: See TracChangeset for help on using the changeset viewer.