That is the formula for average speed. It is good.
You will need IR source for the detectors. IR led, red led, sunlight, firelight, all near-IR sources. Near-IR is just below red light, the IR range is very wire but regular IR-detectors are for near-IR and won't see body heat or even close to that.
Arduino has 2 time functions that return unsigned long values for time since the board started.
One is millis(), it returns milliseconds since startup. The other is micros() for microseconds, but only the closest 4 microseconds.
If I want to know elapsed milliseconds.....
unsigned long startMs, endMs, elapsedMs;
........... somewhere during code execution we get start
startMs = millis();
........... and later we get the end
endMs = millis();
elapsedMs = endMs - startMs; // here is the milliseconds between
It is okay to show you these things but I urge you to work this into your own knowledge to be ready for the next step.
I am very happy to think another engineer or scientist or just person who can DO things is becoming ready.
I can't do your school work but maybe I can help with your understanding of the pieces.
I had a buddy from Venezuela when I was in the Army. That was back in 1978.