Php - how to extract a variable from a loop at a certain time


if($a==50000 && $b==50000){
echo "($a;$b)";
this code eventually prints (50000;50000)
but since it takes so long, I wanted it to print the temporary value of a every 5 seconds, so I have an idea of how long it will take to print the final pair. Is there any way to do that in php? I searched for progressbar in php, but I didn't find anything practical or that solves my problem. I hope you have understood my question. Thanks in advance for willing to help.