FIRST Robotics Competition Blog

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Benchmarking Snippet

Whit-E_Wall-E
NI Employee (retired)

If you are worried about how long a chunk of code is going to take, or just want to quantify that run time, here's a quick and easy way to do it.  Drop the code inside the FOR loop in the snippet below, and calculate the average amount of time it takes to run the code.

This concept is called Benchmarking.  There are other ways of doing this as well.  See the following link for another strategy: http://www.ni.com/example/25532/en/

Benchmarking.png

Regards,

M. Whitaker
ni.com/support