What does a cyclocomputer actually measure for calculating the speed of the bike?
The answer is "both, depending." The majority of current bicycle cyclometers use a reed switch and timer, and measure the time between successive triggerings of the switch as a magnet passes by. An advantage of this method is its simplicity and low cost, though if the magnet is ill-positioned or if the rotational speed of the wheel is too high, the reed switch can get fooled since it takes a while for the reed switch to reset itself. 

A less common approach (used by the old Avocet line of speedometers, including the venerable and venerated Avocet 50) used an induction coil and magnet ring with 20 small magnets attached around the hub. The induction coil could rapidly count the change in current. You can see the details of this approach in the Avocet patent application for the 50, but its designer discussed some of the idiosyncrasies of that approach in this Usenet post from 1994.

Although these two different methods can be used to collect the data needed to calculate speed, the exact algorithms used may differ from device to device. One can see this in the way that cadence is often calculated. Almost all bike computers that have a cadence sensor use a reed switch, since the rotational speed of the cranks is low enough for reed switches to reset. However, different manufacturers use different averaging periods, time-outs, delays, and triggering events before displaying the result. Speed calculations work similarly, and one can occasionally see the evidence of these choices by examining speed and cadence data from bicycle computers that store these values and allow them to be downloaded after the ride. Here, for example, is a graphic that shows the speed recording from three different devices that were mounted on the same bicycle for the same ride (a PowerTap, a Polar S710, and a SRM Pro -- these are power meters but here we focus only on the recorded speed). Each device was set with the same wheel circumference but the histograms show that each stores and reports slightly different speeds.