tests/bench_ztimer: add port of bench_xtimer#17391
Conversation
fjmolinas
left a comment
There was a problem hiding this comment.
Some comments, lets see what Murdock says
|
yeah, I did a |
| * | ||
| */ | ||
| before = ztimer_now(ZTIMER_USEC); | ||
| _base = BASE - (before - start); |
There was a problem hiding this comment.
What's the idea behind this?? Its dynamically changing the offest as the test progresses, this makes some timers trigger unexpectedly depending on how long the test took
There was a problem hiding this comment.
BASE is supposed to be set way in the future, so that during the test, no timer actually triggers.
That's verified by expect(!triggers) throughout the test.
tests/bench_ztimer/main.c
Outdated
| #endif | ||
|
|
||
| #ifndef BASE | ||
| #define BASE (100000LU) |
There was a problem hiding this comment.
| #define BASE (100000LU) | |
| #define BASE (1000000LU) |
Without this with frdm-kw41z I actually have it triggering early...
There was a problem hiding this comment.
I've increased to 10000000 (10 million). It just has to be far enough in the future to never trigger.
|
Please squash! |
249d122 to
22e5e8d
Compare
Contribution description
This is a straight-forward conversion of bench_xtimer to ztimer.
It's using ZTIMER_MSEC by default.
This is very nice to expose the cost of synchronization, e.g., for the rtt on samr21-xpro.
Probably the memory blacklist needs to be updated...
Testing procedure
Issues/PRs references