# Radio Statistics

# Radio Statistics

This module includes functions for radio statistics.

## Summary

| ### Typedefs ||
|---|---|
| `https://openthread.io/reference/group/api-radio#group__api-radio_1gaa30255b0eb092d33887dc1a721086d47` | typedef `struct https://openthread.io/reference/struct/ot-radio-time-stats` Contains the statistics of radio. |

| ### Functions ||
|---|---|
| `https://openthread.io/reference/group/api-radio#group__api-radio_1ga56e2a401d78c3013ec6b330949ff8ff7(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `const https://openthread.io/reference/struct/ot-radio-time-stats *` Gets the radio statistics. |
| `https://openthread.io/reference/group/api-radio#group__api-radio_1gaf8bc1eb86157a3894e8d0d608ca15f2d(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `void` Resets the radio statistics. |

| ### Structs ||
|---|---|
| [otRadioTimeStats](https://openthread.io/reference/struct/ot-radio-time-stats) | Contains the statistics of radio. |

## Typedefs

### otRadioTimeStats

```
struct otRadioTimeStats otRadioTimeStats
```
Contains the statistics of radio.

## Functions

### otRadioTimeStatsGet

```
const otRadioTimeStats * otRadioTimeStatsGet(
  otInstance *aInstance
)
```
Gets the radio statistics.

The radio statistics include the time when the radio is in TX/RX/Sleep state. These times are in units of microseconds. All times are calculated from the last reset of radio statistics.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | |
| **Returns** | A const pointer to the [otRadioTimeStats](https://openthread.io/reference/struct/ot-radio-time-stats) struct that contains the data. |

### otRadioTimeStatsReset

```
void otRadioTimeStatsReset(
  otInstance *aInstance
)
```
Resets the radio statistics.

All times are reset to 0.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | |

## Resources

OpenThread API Reference topics originate from the source code, available
on [GitHub](https://github.com/openthread/openthread/tree/main/include/openthread).
For more information, or to contribute to our documentation, refer to
[Resources](https://openthread.io/resources).