I have an embedded application for the RPi-3. Unfortunately it's likely that uses will remove power without properly shutting the RPi down. Therefore I've got a 'power-going-down' bit of hardware which sets a GPIO bit causing a proper shutdown. The question, of course, is how long does a shutdown take? I'm trying to ensure that the flash program/OS memory does not get corrupted. I've got a lower bound on this time by running a program that toggles another GPIO bit, and seeing when that stops vs. the time when I toggle the shutdown bit; but presumably other things could take more time.
Running the current Raspbian.
TIA! -F