Measuring Speed using rotary encoder

Hello guys, I want to make a speed measurement device using the rotary encoder. The code which i am using is given below. Now my questions are that what will be the unit of speed in the case of below code and how i can improve this code or make it efficient. The rotary encoder, i am using is in this in link. thanks

https://www.ebay.com/itm/Encoder-600P-R-Incremental-Rotary-Encoder-AB-phase-encoder-6mm-Shaft-W-coupling-/300950860643

#define encoder0PinA  2
#define encoder0PinB  4

volatile long encoder0Pos=0;
long newposition;
long oldposition = 0;
unsigned long newtime;
unsigned long oldtime = 0;
long vel;

void setup()
{
  pinMode(encoder0PinA, INPUT);
  digitalWrite(encoder0PinA, HIGH);       // turn on pullup resistor
  pinMode(encoder0PinB, INPUT);
  digitalWrite(encoder0PinB, HIGH);       // turn on pullup resistor
  attachInterrupt(0, doEncoder, RISING);  // encoDER ON PIN 2
  Serial.begin (9600);
  Serial.println("start");                // a personal quirk
}

void loop()
{
newposition = encoder0Pos;
newtime = millis();
vel = (newposition-oldposition) * 1000 /(newtime-oldtime);
Serial.print ("speed = ");
Serial.println (vel);
oldposition = newposition;
oldtime = newtime;
delay(250);
}

void doEncoder()
{
  if (digitalRead(encoder0PinA) == digitalRead(encoder0PinB)) {
    encoder0Pos++;
  } else {
    encoder0Pos--;
  }
}

what will be the unit of speed in the case of below code

What is the circumference of the wheel ?

You are measuring encoder steps per second. Divide that by the number of encoder steps per revolution to get revolutions per second. If the encoder is on a wheel shaft, multiply that by the circumference of the wheel (in meters) to get meters per second.