Low battery detector

Hello,

I would like to design a low battery detector circuit, and alert the user only when the device starts up. Is there any way I can implement the code without using loop()?

Thanks.

alert the user only when the device starts up

Put the alert code in setup().

What is your plan for the most likely event, that the battery dies while the Arduino is running?