digitalread takes in the order of 1-4 uSec the loop should be above 10 millisecs at least. using micros() is OK but won't solve the error I expect..

Note you are doing 10001 iterations, and divide by 1000

for(int xCount=0; xCount<10001; xCount++){

FLOWCALC = countA/((pTime-cTime)/1000)*60;

I don't know the datatypes of the vars used but if ptime and ctime are int/long and ãpprox 40 apart, dividing by 1000 will return zero * 60 is still zero.

Integer math is not forgiving.

Try this formula instead (make ptime and ctime and flowcalc unsigned long )

FLOWCALC = (countA * 60000L)/(pTime-cTime);

Style remark:

It is quite common in C/C++ to write constants/#defines only in upper case and variables not. So FLOWCALC is misleading because of its style.