ZVere
New Contributor
4 years agoMeasure time in NIOS application
Hello,
I used the following code to measure 1usec in baremetal NIOS application.
PERF_RESET (NIOS_PERFORMANCE_COUNTER_BASE); PERF_START_MEASURING (NIOS_PERFORMANCE_COUNTER_BASE); PERF_BEGIN (NIOS_PERFORMANCE_COUNTER_BASE,MY_PERF_ID); usleep (1); PERF_END (NIOS_PERFORMANCE_COUNTER_BASE,MY_PERF_ID); time = perf_get_section_time (NIOS_PERFORMANCE_COUNTER_BASE, MY_PERF_ID);
But according to the clock value, the time is ~2usec, not ~1.
Can you please tell what is wrong in my code ?
Thank you in advance,
Zvika