Nios® V Processor Software Developer Handbook

ID 743810
Date 10/02/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

13.1.1.52. alt_timestamp()

Prototype

alt_u32 alt_timestamp (void)

Commonly Called By

C/C++ programs

Thread-safe

See description.

Available from ISR

See description.

Include

<sys/alt_timestamp.h>

Description

The alt_timestamp() function returns the current value of the timestamp counter.

For more information, refer to “Using Timer Devices” in the "Developing Programs Using the Hardware Abstraction Layer" chapter.

The implementation of this function is provided by the timestamp driver. Therefore, whether this function is thread-safe and or available at interrupt level depends on the underlying driver.

Always call the alt_timestamp_start() function before any calls to alt_timestamp(). Otherwise the behavior of alt_timestamp() is undefined.

Return

Returns the current value of the timestamp counter.