Stay organized with collections
Save and categorize content based on your preferences.
FrameStats
abstract class FrameStats
This is the base class for frame statistics.
Summary
Constants |
static Long |
Undefined time.
|
Public methods |
Long |
Gets the end time of the interval for which these statistics apply.
|
Int |
Gets the number of frames for which there is data.
|
Long |
Get the time a frame at a given index was presented.
|
Long |
Gets the refresh period of the display hosting the window(s) for which these statistics apply.
|
Long |
Gets the start time of the interval for which these statistics apply.
|
Constants
UNDEFINED_TIME_NANO
static val UNDEFINED_TIME_NANO: Long
Undefined time.
Value: -1L
Public constructors
Public methods
getEndTimeNano
fun getEndTimeNano(): Long
Gets the end time of the interval for which these statistics apply. The end interval is the time when the last frame was presented.
getFrameCount
fun getFrameCount(): Int
Gets the number of frames for which there is data.
Return |
Int |
The number of frames. |
getFramePresentedTimeNano
fun getFramePresentedTimeNano(index: Int): Long
Get the time a frame at a given index was presented.
Parameters |
index |
Int: The frame index. |
getRefreshPeriodNano
fun getRefreshPeriodNano(): Long
Gets the refresh period of the display hosting the window(s) for which these statistics apply.
Return |
Long |
The refresh period in nanoseconds. |
getStartTimeNano
fun getStartTimeNano(): Long
Gets the start time of the interval for which these statistics apply. The start interval is the time when the first frame was presented.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# FrameStats\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nFrameStats\n==========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/FrameStats \"View this page in Java\") \n\n```\nabstract class FrameStats\n```\n\n|---|------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.view.FrameStats](#) |\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [WindowAnimationFrameStats](/reference/kotlin/android/view/WindowAnimationFrameStats), [WindowContentFrameStats](/reference/kotlin/android/view/WindowContentFrameStats) |---------------------------------------------------------------------------------------|--------------------------------------------------------| | [WindowAnimationFrameStats](/reference/kotlin/android/view/WindowAnimationFrameStats) | This class contains window animation frame statistics. | | [WindowContentFrameStats](/reference/kotlin/android/view/WindowContentFrameStats) | This class contains window content frame statistics. | |\n\nThis is the base class for frame statistics.\n\nSummary\n-------\n\n| Constants ||\n|-------------------------------------------------------------------------------------|-------------------------------------------------------------------------|\n| static [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | [UNDEFINED_TIME_NANO](#UNDEFINED_TIME_NANO:kotlin.Long) Undefined time. |\n\n| Public constructors ||\n|----------------------------------------|---|\n| [FrameStats](#FrameStats())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | [getEndTimeNano](#getEndTimeNano())`()` Gets the end time of the interval for which these statistics apply. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getFrameCount](#getFrameCount())`()` Gets the number of frames for which there is data. |\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | [getFramePresentedTimeNano](#getFramePresentedTimeNano(kotlin.Int))`(`index:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Get the time a frame at a given index was presented. |\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | [getRefreshPeriodNano](#getRefreshPeriodNano())`()` Gets the refresh period of the display hosting the window(s) for which these statistics apply. |\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | [getStartTimeNano](#getStartTimeNano())`()` Gets the start time of the interval for which these statistics apply. |\n\nConstants\n---------\n\n### UNDEFINED_TIME_NANO\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val UNDEFINED_TIME_NANO: Long\n```\n\nUndefined time. \n\n Value: -1L\n\nPublic constructors\n-------------------\n\n### FrameStats\n\n```\nFrameStats()\n```\n\nPublic methods\n--------------\n\n### getEndTimeNano\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getEndTimeNano(): Long\n```\n\nGets the end time of the interval for which these statistics apply. The end interval is the time when the last frame was presented.\n\n| Return ||\n|------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | The end time in nanoseconds or [UNDEFINED_TIME_NANO](#UNDEFINED_TIME_NANO:kotlin.Long) if there is no frame data. |\n\n### getFrameCount\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getFrameCount(): Int\n```\n\nGets the number of frames for which there is data.\n\n| Return ||\n|----------------------------------------------------------------------------|-----------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | The number of frames. |\n\n### getFramePresentedTimeNano\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getFramePresentedTimeNano(index: Int): Long\n```\n\nGet the time a frame at a given index was presented.\n\n| Parameters ||\n|---------|----------------------------------------------------------------------------------------------|\n| `index` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The frame index. |\n\n| Return ||\n|------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | The presented time in nanoseconds or [UNDEFINED_TIME_NANO](#UNDEFINED_TIME_NANO:kotlin.Long) if the frame is not presented yet. |\n\n### getRefreshPeriodNano\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getRefreshPeriodNano(): Long\n```\n\nGets the refresh period of the display hosting the window(s) for which these statistics apply.\n\n| Return ||\n|------------------------------------------------------------------------------|------------------------------------|\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | The refresh period in nanoseconds. |\n\n### getStartTimeNano\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getStartTimeNano(): Long\n```\n\nGets the start time of the interval for which these statistics apply. The start interval is the time when the first frame was presented.\n\n| Return ||\n|------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | The start time in nanoseconds or [UNDEFINED_TIME_NANO](#UNDEFINED_TIME_NANO:kotlin.Long) if there is no frame data. |"]]