Forum Discussion
Altera_Forum
Honored Contributor
21 years agousleep() accurate ?
Hello all, Does anyone have an idea how to make sure the usleep() fonction is accurate. Whatever values I set usleep() to (which is in the range of 3 to 50), the resulting pause is in the ran...
Altera_Forum
Honored Contributor
21 years agoHello Soin,
I tried the /s, but did not help much....until i figured I was simulating in "debug" mode instead of the "release" mode. Last sim in "release" mode this time with /s showed relatively good accuracy: ask 3-> got 4.3, 12->13.75 and 50 -> 50.85. I will try with the /e... I also tried in the meantime with the alt_timestamp() family of functions which would have been an avenue to create my own my_usleep() function, but since a few calls are required each time, they are not so accurate unless you take into consideration the time for the call to alt_timestamp_start() and alt_timestamp() to elapse. But in that case, since comparisons are involved, I guess I would have obtained better result having the data cache with the /f (haven't tried). Thank you very much for your hints. It helped a lot. Regards, Eric