Ten seconds before the magnitude 6.0 Napa earthquake shook the San Francisco Bay Area on Sunday morning, the ShakeAlert system at the UC Berkeley already knew that it was coming.

A ten-second warning may not seem like much, but think about it — it's enough time for elevators to stop at the next floor and open up, for high-speed trains to slow down and avoid being flung off the tracks, for surgeons to halt operations before the walls start shaking, and for you to take cover under the nearest table just in case the roof caves in.

The ShakeAlert system works on a simple principle: earthquakes travel at the speed of sound, while information travels at the speed of light. So sensors near a quake's epicenter can warn people living much further away faster. It's a more sophisticated version of watching your entire Twitter stream go nuts moments before you feel your own walls shaking.

The LA Times reports that California is working to complete a statewide earthquake-alert system, which could be unveiled in the next few years. The only reason that's holding it back? Money. [LA Times]