wiring.c - timer overflow

In Arduino\hardware\arduino\avr\cores\arduino\wiring.c

Line "clockCyclesToMicroseconds(64 * 256)" should be 250 not 256:

#define MICROSECONDS_PER_TIMER0_OVERFLOW (clockCyclesToMicroseconds(64 * 256)) //Should be 250

clockCyclesToMicroseconds is described simply as the CPU speed divided by 1 million. So a 16mhz cpu returns 16:

#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )
#define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() )

So at 256 the overflow happens at 16384 / 16 = 1024. However MILLIS_INC (the basis for millis() and other timing code) is set to divide by 1000 not 1024. So 24 microseconds are lost at every millisecond(?).

#define MILLIS_INC (MICROSECONDS_PER_TIMER0_OVERFLOW / 1000)

There are 2 other locations where 255 is used in wiring.c. Should be 250?

#ifdef TIFR0
  if ((TIFR0 & _BV(TOV0)) && (t < 255))
    m++;
#else
  if ((TIFR & _BV(TOV0)) && (t < 255))
    m++;
#endif

I found changing all three values to 250 makes RPM reading code much more stable as it reads the millis() inbetween each tacho pulse, then determines the pulses/per minute. Can anyone else confirm a more stable millis() by changing this?

You're not understanding how millis() works, and I believe that your change will make it less accurate for long intervals, even if it makes it more "stable." (You're right that it's not particularly stable. millis() will increment by 2 every 1000/24 milliseconds, or something like that.)

You can read about the logic here: Improving SIG_OVERFLOW (timer0, millis, etc) - Development - Arduino Forum
you should probably use micros() for short-duration timing. Since it uses the overflow count instead of the millisecond count, it shouldn't suffer from the 1024 vs 1000 issues.

How can you say I don't understand how it works when I just described it in full detail? I am asking for more tests. No guessing or believing...

Why would you believe it would be worse for long duration? Millis is based on the Microsecond overflow which is out by 24 microseconds.

I have to change this everytime there's a new build. Can anyone else test this?

Post your actual application code demonstrating the issue plus actual diffs you've made to the core?