Counting pulses without an interrupt

Hello,

I have an RPM sensor that outputs a digital pulse for every rotation.
To calculate the RPMs, I must count the pulses it outputs. However, I cannot implement an interrupt routine (ISR).

How can I count pulses without an interrupt routine?

Thanks in advance

count state changes like this.

untested

int sensorPin = 3;
unsigned long pulseTime; 
unsigned long lastPulseTime;
int lastSensorState = 0; 
int pulseCount;

void setup() 
{
  pinMode(sensorPin, INPUT);  
}

void loop()
{ 
  int sensorState = digitalRead(sensorPin);
  if (sensorState == HIGH) 
  {
    if (lastSensorState == LOW)
    {
      lastPulseTime = pulseTime;
      pulseCount++;
    }
  }
  lastSensorState = sensorState;
  // 
}

I cannot implement an interrupt routine (ISR).

Is this homework?
Cannot implement an ISR or cannot use an external interrupt?

If you are using a 328 or 1284 see Nicks stuff, can easily modify to your needs. Does use "internal" ISR though:

Thank you all for the help.
I cannot implement an ISR because the microprocessor is way too overcharged, which gives me noisy and not so accurate results. So I need some other solution.

The best alternative I've found so far was to count it by hardware (with the counters set to external interrupts)

I cannot implement an ISR because the microprocessor is way too overcharged

What?

which gives me noisy and not so accurate results.

How are results noisy?

The best alternative I've found so far was to count it by hardware (with the counters set to external interrupts)

But you think you can deal with those interrupts? I'm missing something.

The Arduino already has a demanding main loop, I am using all serial ports, I2C, etc. I am using almost all resources already. For this reason, a solution based on ISR does not give satisfatory results, as the Arduino may fail to count some interrupts.
If i use the timer overflow interrupt, OR SOMETHING SIMILAR (and this is my question), I don't need to call an ISR for every pulse and I might get better results.

For this reason, a solution based on ISR does not give satisfatory(sic) results,

Rubbish!

as the Arduino may fail to count some interrupts.

Double rubbish with bells on

Post your code!

Mark

manattta:
The Arduino already has a demanding main loop, I am using all serial ports, I2C, etc. I am using almost all resources already. For this reason, a solution based on ISR does not give satisfatory results, as the Arduino may fail to count some interrupts.
If i use the timer overflow interrupt, OR SOMETHING SIMILAR (and this is my question), I don't need to call an ISR for every pulse and I might get better results.

If (which I very much doubt) an [external ?] ISR might be unsatisfactory why do you think an ISR triggered by a timer would be any better?

The reason for my doubt (in common with @holmes4 and@PaulS) is that the whole point about interrupts is that they get priority.

...R