Stay organized with collections
Save and categorize content based on your preferences.
CpuUsageInfo
class CpuUsageInfo : Parcelable
CPU usage information per core.
Summary
Inherited constants |
From class Parcelable
Int |
CONTENTS_FILE_DESCRIPTOR
Descriptor bit used with describeContents() : indicates that the Parcelable object's flattened representation includes a file descriptor.
|
Int |
PARCELABLE_WRITE_RETURN_VALUE
Flag for use with writeToParcel : the object being written is a return value, that is the result of a function such as "Parcelable someFunction() ", "void someFunction(out Parcelable) ", or "void someFunction(inout Parcelable) ". Some implementations may want to release resources at this point.
|
|
Public methods |
Int |
|
Long |
Gets the active time in milliseconds since the system last booted.
|
Long |
Gets the total time in milliseconds that the CPU has been enabled since the system last booted.
|
Unit |
|
Public methods
describeContents
fun describeContents(): Int
getActive
fun getActive(): Long
Gets the active time in milliseconds since the system last booted.
Return |
Long |
Active time in milliseconds. |
getTotal
fun getTotal(): Long
Gets the total time in milliseconds that the CPU has been enabled since the system last booted. This includes time the CPU spent idle.
Return |
Long |
Total time in milliseconds. |
Properties
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# CpuUsageInfo\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nCpuUsageInfo\n============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/os/CpuUsageInfo \"View this page in Java\") \n\n```\nclass CpuUsageInfo : Parcelable\n```\n\n|---|------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.os.CpuUsageInfo](#) |\n\nCPU usage information per core.\n\nSummary\n-------\n\n| Inherited constants ||\n|---|---|\n| From class [Parcelable](/reference/kotlin/android/os/Parcelable) |----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CONTENTS_FILE_DESCRIPTOR](/reference/kotlin/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) Descriptor bit used with [describeContents()](/reference/kotlin/android/os/Parcelable#describeContents()): indicates that the Parcelable object's flattened representation includes a file descriptor. \u003cbr /\u003e | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [PARCELABLE_WRITE_RETURN_VALUE](/reference/kotlin/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int) Flag for use with [writeToParcel](/reference/kotlin/android/os/Parcelable#writeToParcel(android.os.Parcel,%20kotlin.Int)): the object being written is a return value, that is the result of a function such as \"`Parcelable someFunction()`\", \"`void someFunction(out Parcelable)`\", or \"`void someFunction(inout Parcelable)`\". Some implementations may want to release resources at this point. \u003cbr /\u003e | ||\n\n| Public methods ||\n|------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [describeContents](#describeContents())`()` \u003cbr /\u003e |\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | [getActive](#getActive())`()` Gets the active time in milliseconds since the system last booted. |\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | [getTotal](#getTotal())`()` Gets the total time in milliseconds that the CPU has been enabled since the system last booted. |\n| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [writeToParcel](#writeToParcel(android.os.Parcel,%20kotlin.Int))`(`out:` `[Parcel](/reference/kotlin/android/os/Parcel)`, `flags:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` \u003cbr /\u003e |\n\n| Properties ||\n|----------------------------------------------------------------------------------------------------|----------------------------------------------------------|\n| static [Parcelable.Creator](/reference/kotlin/android/os/Parcelable.Creator)\\\u003c[CpuUsageInfo](#)!\\\u003e | [CREATOR](#CREATOR:android.os.Parcelable.Creator) \u003cbr /\u003e |\n\nPublic methods\n--------------\n\n### describeContents\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun describeContents(): Int\n```\n\n| Return ||\n|----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or [android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR](/reference/kotlin/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) |\n\n### getActive\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getActive(): Long\n```\n\nGets the active time in milliseconds since the system last booted.\n\n| Return ||\n|------------------------------------------------------------------------------|------------------------------|\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | Active time in milliseconds. |\n\n### getTotal\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getTotal(): Long\n```\n\nGets the total time in milliseconds that the CPU has been enabled since the system last booted. This includes time the CPU spent idle.\n\n| Return ||\n|------------------------------------------------------------------------------|-----------------------------|\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | Total time in milliseconds. |\n\n### writeToParcel\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun writeToParcel(\n out: Parcel, \n flags: Int\n): Unit\n```\n\n| Parameters ||\n|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `dest` | The Parcel in which the object should be written. This value cannot be `null`. |\n| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Additional flags about how the object should be written. May be 0 or [PARCELABLE_WRITE_RETURN_VALUE](/reference/kotlin/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int). Value is either `0` or a combination of [android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE](/reference/kotlin/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int), and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |\n\nProperties\n----------\n\n### CREATOR\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val CREATOR: Parcelable.Creator\u003cCpuUsageInfo!\u003e\n```"]]