Using arduino to calculate speed and RPM using hall effect sensor

Trying to use a hall effect sensor to read the speed and rpm of a bicycle wheel. A magnet connected to the wheel will break the connection in the sensor counting the revolutions and in turn changing this to a speed in kmph.

The serial monitor is reading the rpm and speed however the values are 0 and 0 respectively. Below is a copy of the code. Any help would be greatly appreciated

volatile byte revolutions;

unsigned int rpmilli;
float speed;

unsigned long timeold;

void setup()
{
Serial.begin(9600);
attachInterrupt(0, rpm_fun, RISING);

revolutions = 0;
rpmilli = 0;
timeold = 0;
}

void loop()
{
if (revolutions >= 1) {
//Update RPM every 20 counts, increase this for better RPM resolution,
//decrease for faster update

// calculate the revolutions per milli(second)
rpmilli = revolutions/(millis()-timeold);

timeold = millis();
revolutions = 0; 
// WHEELCIRC = 2 * PI * radius (in meters)
// speed = rpmilli * WHEELCIRC * "milliseconds per hour" / "meters per kilometer"

// simplify the equation to reduce the number of floating point operations
// speed = rpmilli * WHEELCIRC * 3600000 / 1000
// speed = rpmilli * WHEELCIRC * 3600

speed = rpmilli * 2.074*3600;

Serial.print("RPM:");
Serial.print(rpmilli * 60000 ,DEC);
Serial.print(" Speed:");
Serial.print(speed,DEC);
Serial.println(" kph");

}
}

void rpm_fun()
{
revolutions++;
}

Hey @danielhicks087

you should attach your interrupt to the pin 2, not 0.

attachInterrupt(2, rpm_fun, RISING);

also, Arduino suggest you to use the following syntax:
attachInterrupt(digitalPinToInterrupt(pin), ISR, mode); (recommended)