Using Hall Sensor(TLE-4905) with Arduino Mega

Back again! After taking a longer look at the code to find reasons for the unwanted increase in number of captured counts when more serial.print lines are added (and thus giving undesired number of extra counts), it just seemed that a single serial.print line didn't cause any issues. But multiple serial.print lines led to increased number of counts.

To address this issue, I decided to put the codes for resetting the time AFTER all of the serial.print lines. So in the code, I placed the following lines of code AFTER all the serial.prints :

current_time = micros();
start_time = micros();   
    
TCCR5B =  bit (CS50) | bit (CS51) | bit (CS52); //restart external clock source

The code that works nicely is now:

unsigned long count_period = 1000;  // units of MICROsec
unsigned int count_to_rpm = 60000UL / count_period; //convert counts to RPM
byte number_of_sensors = 1;
unsigned long final_counts;
unsigned long start_time = micros();
unsigned long measured_time;
unsigned long current_time = micros();

void setup()
{
  Serial.begin(115200);
  TCCR5A = 0; //initialize Timer5
  TCCR5B = 0;
  TCNT5 = 0;
  pinMode( 47, INPUT_PULLUP); //external source pin for timer 5 of MEGA 2560
  //set external clock source pin T5 (digital pin 47) to clock on a rising edge
  TCCR5B =  bit (CS50) | bit (CS51) | bit (CS52);

  //Test pulses to confirm circuit 50 pps =  3000
  pinMode(11, OUTPUT);
  tone(11, 50000);//test pulse jumper pin 11 to pin 47 of MEGA 2560
}

void loop()
{
  current_time = micros();
  
  if (current_time - start_time >= count_period)
  {
    TCCR5B = 0; //stop counter
    final_counts = TCNT5; //frequency limited by unsigned int TCNT5 without rollover counts
    TCNT5 = 0;
    measured_time = current_time - start_time;
    unsigned int rpm = (final_counts * count_to_rpm) / number_of_sensors;

    Serial.print(measured_time);
    Serial.print("\t\t");
    Serial.print(final_counts);
    Serial.print("\t\t");
    Serial.println(rpm);
    
    current_time = micros();
    start_time = micros();   
    
    TCCR5B =  bit (CS50) | bit (CS51) | bit (CS52); //restart external clock source
  }
}

And now we get the expected number of counts of approximately '50' in the following results:

1008 50 3000
1008 49 2940
1012 49 2940
1008 50 3000
1016 49 2940
1004 50 3000