snap to

中上級 (B2) informal

To quickly stand up straight and pay attention, especially when a boss or officer speaks.

"The sergeant barked a command and every soldier snapped to immediately."