PIEDMONT (KPIX 5) — Monday morning’s magnitude 4.0 earthquake that struck in Piedmont proved to be a good test for systems that warn people about an impending quake.

Soon the question, “Did you feel it?” will be followed by, “Did you know it was coming?”

READ MORE: At Least 1 Dead In Fatal Collision In Fremont

“Yes, that was enough time to get warnings to most of the Bay Area,” said Sarah Minson of the U.S. Geological Survey.

At 6:49 a.m., some people heard the warning.

Minson is indeed excited. Because she tests this stuff all the time, but to see it work in real time is what matters.

READ MORE: 200-Acre Mendocino County Vegetation Fire 20% Contained

“Even if you have just a few seconds of warning, that’s enough time to check yourself and check infrastructure,” Minson said.

Here’s how the system works. The first waves from an earthquake are called Primary Waves, or P waves. They don’t do much damage but do alert warning sensors all over California. Behind them are the Secondary Waves, also called S waves, which are slower but do the damage.

From Monday morning’s quake, there was no warning if one was within 9 miles of the epicenter. It doesn’t give waves enough time to warn the sensors.

If you were 15 miles away, you would have had about 3 seconds of warning. From 25 miles, the warning was 7 seconds. For those 50 miles awa, the warning was 20 seconds.

MORE NEWS: Curry Hits 10 3s, Scores 49 in Warriors' Win in Philly

“If you’re a surgeon, that’s enough time to remove your scalpel and step away from the patient,” Minson said.