sample: subys: logging: fix for posix arch
In the POSIX arch, time does not pass inside infinite loops. => Add a small delay in each iteration of those loops when compiled for it. Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
This commit is contained in:
parent
e65ee6870e
commit
169cab0902
1 changed files with 6 additions and 0 deletions
|
@ -171,6 +171,9 @@ static void performance_showcase(void)
|
|||
start_timestamp = timestamp_get();
|
||||
|
||||
while (start_timestamp == timestamp_get()) {
|
||||
#if (CONFIG_ARCH_POSIX)
|
||||
k_busy_wait(100);
|
||||
#endif
|
||||
}
|
||||
|
||||
start_timestamp = timestamp_get();
|
||||
|
@ -179,6 +182,9 @@ static void performance_showcase(void)
|
|||
LOG_INF("performance test - log message %d", cnt);
|
||||
cnt++;
|
||||
current_timestamp = timestamp_get();
|
||||
#if (CONFIG_ARCH_POSIX)
|
||||
k_busy_wait(100);
|
||||
#endif
|
||||
} while (current_timestamp < (start_timestamp + window));
|
||||
|
||||
per_sec = (cnt * timestamp_freq()) / window;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue