How It Works
The way a Cycle Computer works is simple. Each time a magnet on the wheel passes a sensor on the fork a signal is generated. The computer measures the time between those signals and works out how fast you're going, based on the wheel dimension you gave it on initial set up.
From that measurement the computer can also work out a whole range of information including distance, average speed, ride time and maximum speed. Depending on the designer's choices it may also have features like auto on/off — pausing the stopwatch when you're stationary — and different types of timing and average speed. You may get average speed only when you're moving, or for the whole ride, and likewise for time. More sophisticated computers may also be able to warn you if you drop below a target average speed or provide an estimate of how long it'll take to arrive at your destination.