Not exactly. You put a magnet on the part that moves, wheel for speed/distance, and crank for cadence. Sensors mount on a fixed part of the bike within a cm or so of where the magnet passes and detect it each time it comes around counting revolutions. Give the circumference of wheel/tire, revolutions can be used to calculate distance. Circumference and revolutions per minute (RPM) can be used to calculate speed. Neither give power. Power is the product of torque and RPM and some additional means must be provided to measure torque.
What Looigi said plus you can't put a speed sensor on the flywheel to determine speed without knowing the gearing of the model. Even then the speed reading is completely false as you're not moving your mass through air.
However most spin bikes I've seen already have a computer on them with cadence and approximated speed (not that speed matters when you're stationary, it's a completely useless metric). Many even have a power meter built in.
On another note a spin bike isn't really suited to sprint training as there isn't enough resistance to simulate standing starts etc. Check the bikes where you plan on working out before over thinking this.
As Bruin11 said, it's not likely you'll be able to do any kinda mount on the spin bikes. Our gym doesn't even let you use them unless you're in a class. But what I do think might serve you well is to utilize a Heart Rate Monitor - log your time, avg HR and max HR. After a short while, you'll have a very good feel for how much workout you're getting and what kind of aerobic progress you're making.
Yes. Exercise and training is a function of duration and effort. Even when doing structured training on a bike outside, you use effort and duration, not speed or distance. You can used RPE or a HRM for quantifying level of effort, though a power meter is best. A watch or stop watch is good for time. How many time the flywheel of the spin bike rotates is irrelevant and indicative of nothing.