tests: latency_measure: move timing_init() earlier

Move the call to timing_init() earlier before function call
to get frequency. Some arch/SoC/board require initialization
before there is a valid frequency value. Or else the printed
value would not be useful.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2020-09-16 14:06:02 -07:00 committed by Anas Nashif
commit 946c8f0584

View file

@ -32,6 +32,8 @@ void test_thread(void *arg1, void *arg2, void *arg3)
{ {
uint32_t freq; uint32_t freq;
timing_init();
bench_test_init(); bench_test_init();
freq = timing_freq_get_mhz(); freq = timing_freq_get_mhz();
@ -39,8 +41,6 @@ void test_thread(void *arg1, void *arg2, void *arg3)
TC_START("Time Measurement"); TC_START("Time Measurement");
TC_PRINT("Timing results: Clock frequency: %u MHz\n", freq); TC_PRINT("Timing results: Clock frequency: %u MHz\n", freq);
timing_init();
thread_switch_yield(); thread_switch_yield();
coop_ctx_switch(); coop_ctx_switch();