Complement to Jack B's answer:
BVP11 seems much faster than the phototransistor in the link I provided, although I don't know if they measured it using a simple resistor load or a cascode.
So, the phototransistor should be selected for speed.
Good idea using a filter to match laser wavelength and get rid of ambient light. You can also put the transistor inside a long enough opaque tube with blackened internal surface to block ambient light.
Now, you got 2 sensors, so when the object passes, both will generate a pulse. This pulse has 2 edges (on/off).
If the object is shorter than the distance between sensors, you'll get:
- sensor 1 dark
- sensor 1 lit
- sensor 2 dark
- sensor 2 lit
This should be pretty obvious. If the object is longer than the distance between sensors, the order of events will change, but it matters little.
I wanted to attract your attention to the fact that rise and fall times will not be identical, therefore if you measure the time between two edges, make sure they're in the same direction. For example, you can measure the time between both rising edges, or both falling edges, and if the phototransistors have the same speed (you should check) then this will not introduce error.
Now, since you want the magnet's speed, you will be measuring the length of the pulse instead (rising edge - falling edge). If both phototransistors are identical, this will work, but if their rise/fall times are not matched, pulse lengths may be different even though the speed of the magnet stays the same.
I wanted to make sure you were aware of the inconvenience.
Also, if your phototransistors are not matched, or they are at different temperatures, or if the amount of light reaching them differs, then the output current will be different. If you use two dumb comparators with the same threshold, this threshold will be crossed at different points in the two waveforms, and this will introduce an error in the measurement of flight time between sensors. Laser light output may also vary with temperature.
A simple way to solve this problem would be to calibrate the DC level out of the way, by using a circuit like this:
Feed the phototransistor output current into a transimpedance amplifier (ie, a simple opamp). This gives you a voltage and allows the phototransistor to output into a virtual ground, which will mitigate its output capacitance and make it faster. Now, AC-couple (ie, highpass) this voltage to remove the DC light level which corresponds to constant illumination by the laser. Use a hysteresis comparator to detect your pulse's edges.
analogsystemsrf's answer is also excellent! (you can even cascode the phototransistor).
You could use two pairs of sensors instead, each pair measuring speed. In this case you'd measure time between two rising edges, so rise time asymmetry would be less of a problem. Spacing them a little bit more would also improve accuracy.
Another option would be to use modulated light in the MHz range or above, but this is more complex. If you repurpose something like an IrDA or fiber optics receiver, its internal AGC could mess things up.
I would suggest calibrating the system by shooting something which has the same shape as your magnet, but is not magnetic, like a piece of black plastic. Normally it should have the same speed on entry and exit, so you can be sure you're measuring the right thing.