Reputation: 11321
I have a simple php program that analyzes a text (here's the source on github, and here's a somewhat-working demo), but it's excruciatingly slow. Since I'm a beginning programmer, I'm not sure what I'm doing wrong. In python or something, I'd print out debugging messages every step of the way while the program was running, but with php, I don't seem to get any messages until the entire script has run its course. How can I output useful debugging information before the script has finished running, so I can tell which functions are taking the longest time?
Upvotes: 0
Views: 80
Reputation: 7556
You can use ob_flush()
and flush()
to send data as the code is running:
echo "status message 1";
ob_flush();flush();
Upvotes: 1