Quote:
Originally Posted by Ether
1) how many layers of code are wrapped around each of these timers
|
Generally 2 layers + the hardware or whatever the black box routines require. WPILib -> ChipObject (FPGA timer), WPILib -> NI (PPC timer), and WPILib -> vxWorks. All of the WPILib routines are short enough to be inlined for free, but the code structure doesn't allow it.
Quote:
Originally Posted by Ether
2) can each one be used in a critical section
|
WPILib uses these routines outside of critical regions, so I assume they are either lock-free or have their own independent locks.
Quote:
Originally Posted by Ether
3) how long does each take to execute, and
4) is there anybody who has authoritative answers to these questions
|
Testing may be the best way to answer these questions, but I'm also curious about the recommended/official way to handle time. It looks like the FPGA clock is preferred since the other ways of grabbing a timestamp aren't used by WPILib except in Vision. I'll collect some data on our cRIOs tomorrow.