zephyr/tests/kernel/timer/timer_behavior
Nicolas Pitre 4cc21e2f4a tests: timer_behavior: accuracy improvements
Don't sample the first entry outside the timer as this is a different
code path which produces a different offset from the clock tick.

Use sys_clock_hw_cycles_per_sec() to be compatible with systems that
read their hardware clock frequency at run time.

Perform cycle difference computations with uint64_t. If ever the
magnitude of the absolute clock cycle values is greater than 52 bits
then the cast to a double will actually lose accuracy.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-03-02 21:14:52 +01:00
..
src tests: timer_behavior: accuracy improvements 2023-03-02 21:14:52 +01:00
CMakeLists.txt
Kconfig tests: kernel: timer_behavior: Fix building on targets with small SRAM 2022-09-29 13:36:00 -05:00
prj.conf tests: kernel: timer_behavior: improve timer_tick_train output 2023-02-19 20:34:37 -05:00
README test: timer_behavior: Rename readme.md to readme 2022-09-06 17:54:52 -04:00
testcase.yaml yamllint: fix all yamllint line-length errors 2023-01-04 01:16:45 +09:00

# Test a timer implementations variance and long term drift

Records and calculates statistical values against a timer validating that.

1. Timer variance and standard deviation is below defined acceptable values.
2. Periodic timers do not drift in either direction from expected total time.

Timers are meant to be precise and accurate. This test validates an implementation is both.