I have tried some experiements, like removing the costate and using a simple if statement to process data every 20 seconds. I also added an elapsed time printf and I found
that it takes multiple calls to the http_handler() function to transfer the table, ~ 20 or so. Each call lasts from ~30mS to ~180mSec.
1. Using the code below, I get the elapsed time of each handler call, but the browser freezes before the complete table is sent.
2. If I comment out the if & printf statement then I get all the table transferred.
Code:
while (1) {
t0 = MS_TIMER;
http_handler();
delta = MS_TIMER - t0;
if (delta > 10l) printf("\nhttp: %ul", delta);
}