Ignore:
Timestamp:
Nov 23, 2012, 2:09:49 PM (12 years ago)
Author:
chronos
Message:
  • Modified: Real FPS is now measured as cumulative.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest/UMainForm.pas

    r450 r451  
    130130    StartTime := NowPrecise;
    131131    FrameCounterStart := NowPrecise;
     132    FrameCounterStop := 0;
    132133    FrameCounter := 0;
    133134    repeat
     
    140141    until TestTerminated or
    141142      ((TestTimeout > 0) and ((NowPrecise - StartTime) > OneSecond * TestTimeout));
    142     FPS := GetFPS;
     143    FrameCounterStop := NowPrecise;
     144    //FPS := GetFPS;
    143145    Done;
    144146  end;
     
    157159      TestMethod(TDrawMethod(DrawMethods[MethodIndex]));
    158160  finally
    159     TimerUpdateList.Enabled := False;
     161    //TimerUpdateList.Enabled := False;
    160162    SingleTestActive := False;
    161163    UpdateInterface;
     
    234236  with TDrawMethod(DrawMethods[Item.Index]) do begin
    235237    Item.Caption := Caption;
     238    FPS := GetFPS;
    236239    Item.SubItems.Add(FloatToStr(RoundTo(FPS, -3)));
    237     Item.SubItems.Add(FloatToStr(RoundTo(FrameDuration / OneMillisecond, -3)));
     240    if FPS > 0 then
     241      Item.SubItems.Add(FloatToStr(RoundTo(1 / FPS * 1000, -3)))
     242      else Item.SubItems.Add('0');
    238243    if FrameDuration > 0 then
    239244      Item.SubItems.Add(FloatToStr(RoundTo(1 / (FrameDuration / OneSecond), -3)))
    240245      else Item.SubItems.Add('0');
    241     Item.SubItems.Add(FloatToStr(RoundTo(StepDuration / OneMillisecond, -3)));
     246    Item.SubItems.Add(FloatToStr(RoundTo(FrameDuration / OneMillisecond, -3)));
    242247    if FrameDuration > 0 then
    243248      Item.SubItems.Add(FloatToStr(RoundTo(1 / (StepDuration / OneSecond), -3)))
    244249      else Item.SubItems.Add('0');
     250    Item.SubItems.Add(FloatToStr(RoundTo(StepDuration / OneMillisecond, -3)));
    245251  end;
    246252end;
Note: See TracChangeset for help on using the changeset viewer.