don't rely on delay(1000); to assume you have 1s in between two cycles of the loop.
use a dynamic time based approach: remember the last time you made a measure and when you calculate your velocity you can take into account the actual clock time ∆t = current time - previous time
static unsigned long previousMicros=0;
unsigned long currentMicros = micros(); // you could do this with millis() too, depends on the precision you want
if (currentMicros - previousMicros >= 1000000ul) { // 1s in µs
unsigned long deltaT = currentMicros - previousMicros; // that will be give or take 1s
// time to get a new read
// ... your code here and use deltaT for elapsed time since last measure (of course convert into the right unit)
previousMicros = currentMicros;
}
...