Function anj_time_monotonic_now

Function Documentation

anj_time_monotonic_t anj_time_monotonic_now(void)

Returns the current monotonic time point.

The result is a time point measured from an arbitrary monotonic epoch (typically system boot) and must not be affected by wall-clock adjustments such as NTP synchronization, time zone changes, or manual edits. Resolution is platform-dependent.

The monotonic clock used by Anjay Lite must never stop or go backwards: it needs to be a continuously advancing time base even if the system enters sleep/suspend. If the platform’s default monotonic clock stops across suspend, use a clock source that continues counting (or implement sleep-time compensation).

Note

Since clock precision and drift affect retransmission timers, registration lifetime handling and other timeouts, integrations should take drift into account, especially for operations scheduled at long intervals (e.g., sending an UPDATE once per day) where small errors can accumulate over time.

Returns:

anj_time_monotonic_t representing “now” on a monotonic clock.