A timestamp in a sensor network is used to synchronize the clocks of different sensors, to measure the latency and reliability of the network, and to correlate sensor data with real-world events.