How fast does the thing loop a second? 40 times???
In the best case scenario, 40 loops/sec is what you’re going to get. That’s how often the master CPU has a new data packet ready for you. Now, if you are doing a lot of “heavy” calculations in your code, you may miss one or two packets, and run slightly slower. The variable delta_t will tell you, I believe, how many packets have been missed.