On Thu, 18 Feb 2021 08:27:48 -0800 (PST), in
gmane.comp.hardware.beagleboard.user Walter Cromer
<walterc-2dFtBuzUeF/[email protected]> wrote:
>I think if I could just find how to read the clock on the PRU with C, I can
>probably take it from here. And of course, it needs to be giving me
>milliseconds. From what I read the main clock functions don't work below
>seconds.
Have you even looked at the link I posted some hours ago? Duplicated
below.
>On Wed, 17 Feb 2021 10:45:49 -0800 (PST), in
>gmane.comp.hardware.beagleboard.user Walter Cromer
><walterc-2dFtBuzUeF/[email protected]>
> wrote:
>
>>You are correct that this application does not need to know the actual real
>>time but only the relative (elapsed) time since the subroutine began. I'm
>>familiar with clock_gettime but didn't think it could give me subsecond
>>information. I'll explore it!
>>
>
>https://www.tutorialspoint.com/c_standard_library/c_function_clock.htm
>
> The worst you may have to handle is the wrap-around in a long-running
>program.
According to the documentation, that function returns clock TICKS
(whatever the tick rate is for the system in question). If you know the
CLOCKS_PER_SECOND you should be able to compute the clocks per
millisecond...
https://linux.die.net/man/3/clock
or use
https://linux.die.net/man/2/times
or better
https://linux.die.net/man/2/clock_gettime in which the return structure is
seconds AND NANOSECONDS
--
Dennis L Bieber
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/vsct2gpnn5bt691c6kfggvoe6p2miehf4u%404ax.com.