What if you had just a few seconds to protect yourself in an earthquake, like getting under a table or a desk? What if you were a train engineer who could begin to slow down?

With an earthquake early warning system, giant valves could now close automatically in time to prevent precious water from draining out of broken pipes at water utilities, and the list goes on.

The first stages of that system have arrived. What’s called ShakeAlert is now in place in Washington, Oregon, and California. Now scientists at the University of Washington, along with the U.S. Geological Survey, are in the process of doubling the number of digital seismometers to make the system more robust and work faster, with better accuracy.

A seismometer is the sensitive instrument that creates that squiggly line you see associated with earthquakes. The ShakeAlert system takes data from four or more digital seismometers to begin automatically calculating how much time one has before the shaking reaches you. It will also tell you how strong the shaking is expected to be once it arrives.

The idea is pretty simple. The farther away you are from where an earthquake starts, the more time you have to brace yourself. If you’re sitting on top of an earthquake epicenter, there’s obviously no time. But if it was the big magnitude 9 coastal earthquake, which is the region’s worst case scenario, the population centers of metropolitan Seattle and Tacoma could have as many as three minutes warning, if the quake were to start off Cape Mendocino, California where the fault begins.

"That rupture front, we call it, takes about two miles per second, which is how fast it propagates," said Paul Bodin, the manager of the Pacific Northwest Seismic Network at the University of Washington.

RELATED: ‘Great ShakeOut’ drill helps prepare Washington for the ‘Big One’

There are two waves critical in earthquakes. The first is the P wave, which travels fast, but creates no damage. The damaging S waves are slower.

In other words, timing is everything. Each seismometer is connected to a global positioning antenna, which not only says precisely where a seismometer and its antenna are located, but keeps the network of seismometers all on the same exact time.

All the sesimometers transmit to a central computer, which makes the calculation and sends the warnings out. The location of a particular computer, and eventually a cell phone app, will determine how much time that location or individual has before the worst shaking hits. Right now, ShakeAlert is available for large businesses and government agencies.

RELATED: Prepare to be on your own in a major Pacific Northwest disaster

For decades, the seismic network has relied on analog instruments, some of which are not very old. While sensitive, they can also become overdriven by a violent earthquake. There are now 220 sites around the state that are digitized, meaning they can transmit a little faster. Depending on the design of the seismometer, they can also better record strong motion without going off the charts. Digital signals also don’t need to be converted from analog, saving additional time, in a system where fractions of seconds matter.

The plan is to have 560 digital sites running over the next few years in both Washington and Oregon. The immediate plan between now and August 2020 is to have 83 additional sites, with 50 smaller seismic stations bolted to the floors of locations such as schools and fire stations and costing as little as $12,000 each. Those sites would rely on internet connections from those buildings along with electrical power, but still have battery backups.

Then 33 much larger solar-powered remote stations, with more sophisticated seismometers costing up to $40,000 each, are also construction. The idea is to get more of the stations closer to the array of faults threatening the region. Several million dollars in federal grant money is helping to fund the project.

"The stations need to be upgraded to be more robust," Bodin said of the network. "Up until now, we’ve been concentrating on upgrades. Over the next year and a half, we’ve been given funding to actually put in new stations to densify the network, so the performance of the network will increase."

The digitized improvements could add another 5-10 seconds of warning to those locations further away from an earthquake’s start, said Bodin. Plus, the system would become even more accurate.

Complete Disaster Preparedness coverage on KING 5