|
Re: Time in Milliseconds
Hmm... Well, I'm sure that there's something buried in the WPILib that can do it for you like using the time() function. But, from a VxWorks perspective, you can issue a:
-> sysClkRateGet()
This will tell you the interrupt rate of the system clock. And, sysClkRateSet(100) would set the interrupt rate to 100 Hz (10 ms clock resolution).
With that, tickGet() will return the current clock tick count with subsequent calls allowing you to measure elapsed time to the resolution of the system clock.
And, taskDelay(1) is a delay of 1 clock tick (10 ms at 100 Hz). You can also create watchdog timers that will attach your code to the system clock interrupt service routine and run it at a specified delay. Again, I'm sure that there's something buried in the WPILib that can provide what you're looking for, but I know VxWorks a lot better than I know the WPILib.
HTH,
Mike
|