The target platform can provide particular clock chips and/or clock source drivers in addition to the architecture-specific ones. For instance, some device on a PCI bus could implement a timer chip which the application wants to use for timing its threads, in addition to the architected timer found on ARM64 and some ARM-based SoCs. In this case, we would need a specific clock driver, binding the timer hardware to the EVL core.
EVL’s clock element ensures that all clock drivers present the same interface to applications in user-space. In addition, the clock element can export individual software timers to applications which comes in handy for running periodic loops or waiting for oneshot events on a specific time base.
EVL abstracts clock event devices and clock sources (timekeeping hardware) into a single clock element.
EVL defines two built-in clocks, you can pass any of the following identifiers to EVL calls which ask for a clock file descriptor (usually noted as clockfd):
EVL_CLOCK_MONOTONIC is the exact equivalent of the POSIX
CLOCK_MONOTONIC clock, which is a monotonically increasing clock
that cannot be set and represents time since some unspecified
EVL_CLOCK_REALTIME is the exact equivalent of the POSIX
CLOCK_REALTIME clock, which is a non-monotonic wall clock which
can be manually set to an arbitrary value with proper privileges,
and can also be subject to dynamic adjustements by the NTP system.
If you are to measure the elapsed time between two events, you
definitely want to use