-
public class FpsDebugFrameCallback extends ChoreographerCompat.FrameCallback
Each time a frame is drawn, records whether it should have expected any more callbacks since the last time a frame was drawn (i.e. was a frame skipped?). Uses this plus total elapsed time to determine FPS. Can also record total and expected frame counts, though NB, since the expected frame rate is estimated, the expected frame count will lose accuracy over time.
Also records the JS FPS, i.e. the frames per second with which either JS updated the UI or was idle and not trying to update the UI. This is different from the FPS above since JS rendering is async.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
FpsDebugFrameCallback.FpsInfo
-
Constructor Summary
Constructors Constructor Description FpsDebugFrameCallback(ReactContext reactContext)
-
Method Summary
Modifier and Type Method Description void
doFrame(long l)
Just a wrapper for frame callback, see . void
start()
void
startAndRecordFpsAtEachFrame()
void
stop()
double
getFPS()
double
getJSFPS()
int
getNumFrames()
int
getNumJSFrames()
int
getExpectedNumFrames()
int
get4PlusFrameStutters()
int
getTotalTimeMS()
FpsDebugFrameCallback.FpsInfo
getFpsInfo(long upToTimeMs)
Returns the FpsInfo as if stop had been called at the given upToTimeMs. void
reset()
-
-
Constructor Detail
-
FpsDebugFrameCallback
FpsDebugFrameCallback(ReactContext reactContext)
-
-
Method Detail
-
doFrame
void doFrame(long l)
-
start
void start()
-
startAndRecordFpsAtEachFrame
void startAndRecordFpsAtEachFrame()
-
stop
void stop()
-
getFPS
double getFPS()
-
getJSFPS
double getJSFPS()
-
getNumFrames
int getNumFrames()
-
getNumJSFrames
int getNumJSFrames()
-
getExpectedNumFrames
int getExpectedNumFrames()
-
get4PlusFrameStutters
int get4PlusFrameStutters()
-
getTotalTimeMS
int getTotalTimeMS()
-
getFpsInfo
@Nullable() FpsDebugFrameCallback.FpsInfo getFpsInfo(long upToTimeMs)
Returns the FpsInfo as if stop had been called at the given upToTimeMs. Only valid ifmonitoring was started with startAndRecordFpsAtEachFrame.
-
reset
void reset()
-
-
-
-