Package panamagl.performance
Class RenderCounter
java.lang.Object
panamagl.performance.RenderCounter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intprotected intprotected TicTocMeasure time between each repaint query.protected intprotected intprotected intprotected TicTocShould starts upon invocation of display() or receival of resize events, stop once paintComponent() has completed image rendering.protected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn true if the difference between the number of paint and update has changed since last counter update.intvoidvoidonPaint()voidvoidvoidvoidonUpdate()intintbooleanintvoidupdate()Update difference between the number of paint and update events.void
-
Field Details
-
update
protected int update -
paint
protected int paint -
display
protected int display -
diff
protected int diff -
prevDiff
protected int prevDiff -
renderDrift
protected int renderDrift -
prevRenderDrift
protected int prevRenderDrift -
renderTimer
Should starts upon invocation of display() or receival of resize events, stop once paintComponent() has completed image rendering. -
paintInterval
Measure time between each repaint query.
-
-
Constructor Details
-
RenderCounter
public RenderCounter()
-
-
Method Details
-
onPaintComponentBefore
public void onPaintComponentBefore() -
onStartRendering
public void onStartRendering() -
onStartPainting
public void onStartPainting() -
onUpdate
public void onUpdate() -
onPaint
public void onPaint() -
onDisplay
public void onDisplay() -
update
public void update()Update difference between the number of paint and update events. -
updatePrevDiff
public void updatePrevDiff() -
diffChanged
public boolean diffChanged()Return true if the difference between the number of paint and update has changed since last counter update. -
renderTimeMsInfo
-
eventCountInfo
-
paintIntervalVsRenderTimeDiffInfo
-
paintIntervalMsInfo
-
renderLongerThanRepaintInterval
public boolean renderLongerThanRepaintInterval() -
paintIntervalMs
public int paintIntervalMs() -
renderTimeMs
public int renderTimeMs() -
eventDiffDerivative
public int eventDiffDerivative()- Returns:
- variation between now and previous measure of the difference between display and paint events count.
-
renderDriftDerivative
public int renderDriftDerivative()
-