-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong timeouts with Raspberry Pi port (ESF-5) #27
Comments
dobairoland
changed the title
Wrong timeouts with Raspberry Pi port
Wrong timeouts with Raspberry Pi port
Dec 7, 2022
github-actions
bot
changed the title
Wrong timeouts with Raspberry Pi port
Wrong timeouts with Raspberry Pi port (ESF-5)
Dec 7, 2022
Thank you for the submission and sorry for the big delay in the reply, we've only recently added Github issue tracking for this project. This does seem to be correct, I will investigate and test the changes suggested. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
These lines of code:
esp-serial-flasher/port/raspberry_port.c
Lines 286 to 296 in e13fa45
are incorrect. The clock() routine returns how much processor time is used by the application, not how much processor time has passed. An example of checking this is doing (by using a system call to sleep, plus spinning for some "user" time measurement, but measuring across the span of both with clock()):
which outputs:
You can see that clock() isn't suitable for measuring how much real time has elapsed (only "user" time). It'd be better to utilize the POSIX API
clock_gettime(CLOCK_MONOTONIC, xxx)
instead.The text was updated successfully, but these errors were encountered: