You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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()):
$ time ./test
clock() duration: 0.167709
clock_gettime() duration: 1.167781
real 0m1.169s
user 0m0.169s
sys 0m0.000s
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:
dobairoland
changed the title
Wrong timeouts with Raspberry Pi port
Wrong timeouts with Raspberry Pi port
Dec 7, 2022
github-actionsbot
changed the title
Wrong timeouts with Raspberry Pi port
Wrong timeouts with Raspberry Pi port (ESF-5)
Dec 7, 2022
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: