I am trying to run a custom application with px4 autopilot on Pixhawk 4. I need to time need to execute certain portions of the code. There are two ways how we can do that:
- Output a message to log with a timestamp
- Read system time or clock at the beginning and at the end of the code block.
Which would be the better way to do? Or is there any other way to do the same?