Time (C-API)

This page describes the C implementation of Time

group TIME_MONO

Functions

a0_err_t a0_time_mono_now(a0_time_mono_t*)

Get the current mono timestamps.

a0_err_t a0_time_mono_str(a0_time_mono_t, char mono_str[20])

Stringify a given mono timestamps.

a0_err_t a0_time_mono_parse(const char mono_str[20], a0_time_mono_t*)

Parse a stringified mono timestamps.

a0_err_t a0_time_mono_add(a0_time_mono_t, int64_t add_nsec, a0_time_mono_t*)

Add a duration in nanoseconds to a mono timestamp.

Variables

const char A0_TIME_MONO[]

Header key for mono timestamps.

struct a0_time_mono_t
#include <time.h>

Monotonic timestamp. Despite the name, uses CLOCK_BOOTTIME.

group TIME_WALL

Functions

a0_err_t a0_time_wall_now(a0_time_wall_t*)

Get the current wall timestamps.

a0_err_t a0_time_wall_str(a0_time_wall_t, char wall_str[36])

Stringify a given wall timestamps.

a0_err_t a0_time_wall_parse(const char wall_str[36], a0_time_wall_t*)

Parse a stringified wall timestamps.

Variables

const char A0_TIME_WALL[]

Header key for wall timestamps.

struct a0_time_wall_t
#include <time.h>

Wall clock timestamp.