Serial monitor works fine , but not when it is connected to blynk

Hello, i need help on my project. Currently im using NodeMCU ESP 8266 and it is connected to hall sensor, to get the reading of the fan, and the output power of the fan. So , these are my codes :

#####################################################################################

> #define BLYNK_PRINT Serial
> #include <ESP8266WiFi.h>
> #include <BlynkSimpleEsp8266.h>
> 
> char auth[] ="a94d8ad4d656402e9bd5c18ca2571ea3" ; 
> //"a94d8ad4d656402e9bd5c18ca2571ea3"; USER 1
> //"9a4db6295a2b4b6284b8e7438a79f513" ; USER 2
> char ssid[] = "Faiz's Phone";
> char pass[] = "faiz1996";
> BlynkTimer timer;
> 
> 
> const int hallSensorPin1 = 2;// connect the hall effect sensor on pin D3
> const int hallSensorPin2= 0;
> const unsigned long sampleTime = 1000;
> int countRpm,totalcountRpm;
> unsigned long prevMillis;
> int count,countemailp,countemailn;
> void setup() 
> {
>   WiFi.begin(ssid,pass);
>   Blynk.config(auth);
>   if(WiFi.status() == WL_CONNECTED)
>   {
>     Blynk.begin(auth,ssid,pass);
>   }
>    timer.setInterval(1000L, myTimerEvent);
>   pinMode(hallSensorPin1,INPUT);
>    pinMode(hallSensorPin2,INPUT);
>   Serial.begin(9600);
> }
> int a =0 ;
> int b =0 ;
> float angspeed, power  ; 
> const float  r = 0.125;           
> bool flag,flagemailp,flagemailn;
> int force = 12;
> float torque = force * r;
> 
> void loop() 
> {
>   
>   getCount();
>   if (millis () - prevMillis >= sampleTime){
>     int b =getRpm();
>     Serial.print("RPM:");
>     Serial.println(b);
>     angspeed = b * 2 * 3.142 /60;
>     power = torque * angspeed;
>     Serial.print("Power : " );
>     Serial.println(power);
>     if (b == 0 and flag == 0){
>       a = millis();
>       flag = 1;
>     }
>    else if (b != 0 and flag == 1 ){
>     flag=0;
>    }
>   count = 0;
>   prevMillis = millis();
>   }
>   if (millis() - a  >= 10000 and flag == 1){
>    Serial.print("Turbine not moving");
>  // Blynk.notify("Not Moving");
>   a=millis();
>   flag=0;
>   }
>  
>   if(WiFi.status() == WL_CONNECTED){
>     if(Blynk.connected() == true){
>       Blynk.run();
>     }
>     else{
>       Blynk.begin(auth,ssid,pass);
>       Blynk.run();
>     }
>   }
>  
>   timer.run(); // running timer every second
>   
>   WidgetLCD lcd(V2);
>   lcd.clear();
>   if (b==0)
>   {
>     lcd.print(6,0,"BAD");
>   }
>   else
>   {
>     lcd.print(5,0,"GOOD");
>   }
>  
> }
> 
> void getCount()
> {
>   
>   static bool flagpositive, flagnegative;
>   static bool state1, state2, prevState1, prevState2;
>   boolean countFlag = LOW;
>     state1 = digitalRead (hallSensorPin1);
>     state2 = digitalRead (hallSensorPin2);
>     if((state1 != prevState1) and (prevState1 == 1) )
>     {
>       if (state2){ 
>         flagpositive=1;
>         if (flagpositive and !flagnegative)
>         {
>           count++;
>           Serial.print("Count : ");
>           Serial.println(count);
>          
>         }
>         else
>         {
>           count=0;
>           //Blynk.notify("Opposite Direction");
>           Serial.print("Opposite Direction");
>           flagpositive = 0;
>           if(countemailp==1 and flagemailp==0){
>       //      Blynk.email(" There is a problem occured in turbine. Please fix it immediately");
>             countemailp=0;
>             flagemailp=1;
>           }
>           else if(countemailp==15 and flagemailp==1){
> //            Blynk.email(" There is a problem occured in turbine. Please fix it immediately");
>             countemailp=0;
>             flagemailp=0;
>         }
>       }
>     }
>     }
>       else if  (!state2 and prevState2)
>       {
>      
>         prevState2= state2;
>         if (state1){
>         flagnegative=1;
>         if (!flagpositive and flagnegative)
>         { 
>           
>           count++;
>           Serial.print("Count : ");
>           Serial.println(count);
>           
>         }
>         else
>         {
>           count=0;
>           Serial.print("Opposite Direction");
>           //Blynk.notify("Opposite Direction");
>           flagnegative = 0;
>           countemailp=countemailp+1;
>           if(countemailp==1 and flagemailp==0){
>           //  Blynk.email(" There is a problem occured in turbine. Please fix it immediately");
>             countemailp=0;
>             flagemailp=1;
>           }
>           else if(countemailp==15 and flagemailp==1){
> //            Blynk.email(" There is a problem occured in turbine. Please fix it immediately");
>             countemailp=2 ;
>             flagemailp=0;
>           }
>         }
>        }
>       }
>     prevState1 = state1;
>     prevState2 = state2;
>    
> }     
> int getRpm(){
>   countRpm = int(60000/float(sampleTime))*count;
>  totalcountRpm=countRpm/6;
>  return totalcountRpm;
> }
> void myTimerEvent()
> {
>   Blynk.virtualWrite(V2, totalcountRpm);
>   Blynk.virtualWrite(V1, power);
> }


##################################################################################### 

The problem that im facing right now is the data obtained when it is connected to blynk. Before i connect to blynk, i test the program, and it is working perfectly fine. For example, i can get up to 80-90 RPM constantly . However, all i do is just connect to blynk and did the same test, and the results are, 0 - 10 RPM all the time. Most of the time it shows 0 RPM, as if the Blynk is slowing down the process in the program. Any suggestion to fix this problem ?

Blynk won’t work with your void loop full of code like this. You need to read this article:
http://help.blynk.cc/getting-started-library-auth-token-code-examples/blynk-basics/keep-your-void-loop-clean

https://pradeepsinghblog.files.wordpress.com/2016/04/nodemcu_pins.png?w=460&zoom=2

Also GPIO2 isn’t D3 on the NodeMCU, it’s D4.
GPIO 0 (Pin D3) isn’t a good Pin to use. Read this:

Pete.