I recall being stuck in a closet for hours during tornado warnings multiple times throughout my life. It gets boring. Programming is a good way to pass the time.
Even after I evacuated my family further from the action, we still had missile strikes and air raid warnings. Being away from home, learning about horrible things happening in your country, those things do not help with being productive.