Pitfalls of RegisterRepeatingTimer?

RegisterRepeatingTimer isn’t a well documented feature, but I’m interested in using it in a project.

What are some possible pitfalls of RegisterRepeatingTimer?
What if I used RegisterRepeatingTimer instead of a infinite main loop?
Is RegisterRepeatingTimer reliable and well tested?

The pitfalls are related to attempting multitasking in general, things being read and written out of order, delays causing missed encoder counts, or weird ultrasonic readings. It’s a great thing but needs to be handled carefully. Attempting to multitask for an inexperienced user can be more trouble then it’s worth, so if you want to use this feature make sure you have time to troubleshoot and don’t implement it 5 minutes before competition. If it was “easy” we would have made a block for it. We consider it important which is why it’s in API.h.

From the help file:

Note: These functions are for advanced users with programming experience. If you do not feel comfortable with advanced programming techniques, do not use this feature.

The Register Repeating Timer creates an interrupt service routine that will interrupt the controller and run a specified function at an interval in milliseconds. This function can be found in API.h.

RegisterRepeatingTimer (time in ms, function name): Allows the user to call a function at a regular interval.

CancelTimer (function name): Stops the function from being called.

Caution: It is extremely important that no delays are in the function being called, such as a wait statement, print to screen, and graphic display. Doing this could cause your robot to act erratically.

Caution: Do not use this function while using integrated motor encoders. Instead, use Register IME Repeating Timer.