BERKELEY (KRON) — A 4.0 earthquake rattled the Bay Area Monday morning.

The short, sharp earthquake struck just north of Piedmont in the East Bay. But it was felt across the Bay in San Francisco and along the Peninsula.

New technology being developed at UC Berkeley is in the testing phase. And it could warn the public when an earthquake is about to hit.

“The technology already exists to get an earthquake warning on your smartphone. All they need now is the funding,” Seismologist Richard Allen said.

“Earthquake. Drop cover and hold on. Strong shaking expected,” the app would say.

The app would give you a countdown to the next earthquake right when it’s about to strike. As an example, it’s simulating the Loma Prieta earthquake.

Depending where you were, some people could have known up to 20 seconds before the shaking.

“It gets the location of the earthquake, the size of the earthquake, and it tells you what to expect at your location,” Allen said.

Seismologists have been testing the technology for three years. And it works.