Hi,
I want to slow down my script so that
mySQL server can keep up.
I am counting the row numbers with $cnt
so after $cnt++; I want to add:
if ($cnt xxx ) sleep(2);
now xxx needs to be "any multiple of 1000" but I am
not sure how to code that.
As I am processing upto 30,000 records, I can not write out
if ($cnt == 1000 || $cnt == 2000 || $cnt == 3000 || $cnt == 4000 || etc etc up to 30,000)
Does anyone know how I can do this ?
Thanks
I want to slow down my script so that
mySQL server can keep up.
I am counting the row numbers with $cnt
so after $cnt++; I want to add:
if ($cnt xxx ) sleep(2);
now xxx needs to be "any multiple of 1000" but I am
not sure how to code that.
As I am processing upto 30,000 records, I can not write out
if ($cnt == 1000 || $cnt == 2000 || $cnt == 3000 || $cnt == 4000 || etc etc up to 30,000)
Does anyone know how I can do this ?
Thanks
Comment