Improves logging message for dropped frames

This commit is contained in:
Vitor Pamplona
2024-07-16 11:47:41 -04:00
parent 47a9a6cc4e
commit 87b8e18f1c
@@ -178,10 +178,10 @@ object ChoreographerHelper {
return return
} }
val diff = (frameTimeNanos - lastFrameTimeNanos) / 1000000 val diff = (frameTimeNanos - lastFrameTimeNanos) / 1000000
if (diff > 16.6f) { if (diff > 20) {
// Follow the frame number // Follow the frame number
val droppedCount = (diff / 16.6).toInt() val droppedCount = (diff / 16.6).toInt()
Log.w("block-canary", "Dropped Frames $droppedCount") Log.w("block-canary", "Dropped $droppedCount frames. Skipped $diff ms")
} }
lastFrameTimeNanos = frameTimeNanos lastFrameTimeNanos = frameTimeNanos
Choreographer.getInstance().postFrameCallback(this) Choreographer.getInstance().postFrameCallback(this)