Skip to content

Clock library

Defines

CLOCK_SECOND

#define CLOCK_SECOND

A second, measured in system clock time.

Types

clock_time_t

typedef uint32_t clock_time_t;

clock_interval_t

typedef int32_t clock_interval_t;

Functions

clock_time

clock_time_t clock_time(void);

Get the current clock time.

This function returns the current system clock time.

Return value

The current clock time, measured in system ticks.

clock_diff

clock_interval_t clock_diff(clock_time_t time_a, clock_time_t time_b);

Get the duration between two timestamps.

Return value

Number of milliseconds between two timestamps.

clock_seconds

unsigned long clock_seconds(void);

Get the current value of the platform seconds.

This could be the number of seconds since startup, or since a standard epoch.

Return value

The value.

Back to top