---
name: "rte_cycles.h"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_cycles.h"
---

# rte\_cycles.h(3)

## NAME

rte\_cycles.h

## SYNOPSIS

`#include <stdint.h>`\
 `#include <rte_debug.h>`\
 `#include <rte_atomic.h>`\

### Functions

uint64\_t **rte\_get\_tsc\_hz** (void)\
 static uint64\_t **rte\_get\_tsc\_cycles** (void)\
 static uint64\_t **rte\_get\_timer\_cycles** (void)\
 static uint64\_t **rte\_get\_timer\_hz** (void)\
 static void **rte\_delay\_ms** (unsigned ms)\
 void **rte\_delay\_us\_block** (unsigned int us)\
 void **rte\_delay\_us\_sleep** (unsigned int us)\
 void **rte\_delay\_us\_callback\_register** (void(\*userfunc)(unsigned int))\

### Variables

void(\* **rte\_delay\_us** )(unsigned int us)\

## Detailed Description

Simple Time Reference Functions (Cycles and HPET).

Definition in file **rte\_cycles.h**.

## Function Documentation

### uint64\_t rte\_get\_tsc\_hz (void)

Get the measured frequency of the RDTSC counter

**Returns**

The TSC frequency for this lcore

### static uint64\_t rte\_get\_tsc\_cycles (void)` [inline]`, ` [static]`

Return the number of TSC cycles since boot

**Returns**

the number of cycles

### static uint64\_t rte\_get\_timer\_cycles (void)` [inline]`, ` [static]`

Get the number of cycles since boot from the default timer.

**Returns**

The number of cycles

Definition at line **97** of file **rte\_cycles.h**.

### static uint64\_t rte\_get\_timer\_hz (void)` [inline]`, ` [static]`

Get the number of cycles in one second for the default timer.

**Returns**

The number of cycles in one second.

Definition at line **119** of file **rte\_cycles.h**.

### static void rte\_delay\_ms (unsigned ms)` [inline]`, ` [static]`

Wait at least ms milliseconds.

**Parameters**

*ms* The number of milliseconds to wait.

Definition at line **151** of file **rte\_cycles.h**.

### void rte\_delay\_us\_block (unsigned int us)

Blocking delay function.

**Parameters**

*us* Number of microseconds to wait.

### void rte\_delay\_us\_sleep (unsigned int us)

Delay function that uses system sleep. Does not block the CPU core.

**Parameters**

*us* Number of microseconds to wait.

### void rte\_delay\_us\_callback\_register (void(\*)(unsigned int) userfunc)

Replace rte\_delay\_us with user defined function.

**Parameters**

*userfunc* User function which replaces rte\_delay\_us. rte\_delay\_us\_block restores builtin block delay function.

## Variable Documentation

### void(\* rte\_delay\_us) (unsigned int us) (unsigned int us)` [extern]`

Wait at least us microseconds. This function can be replaced with user-defined function.

**See also**

**rte\_delay\_us\_callback\_register**

**Parameters**

*us* The number of microseconds to wait.

## Author

Generated automatically by Doxygen for DPDK from the source code.
