That's a loaded question. It really depends on the cause of death. If you're agonal breathing after drowning you may well already be in or near cardiac arrest. If you're overdosing on opioids it may be minutes or longer before you're fully gone. Agonal breathing doesn't always occur either. Agonal breathing, keep in mind, is not considered true breathing. It is a reflex but should not be considered as someone truly exchanging air. If a patient is agonal breathing a medical professional will be giving rescue breaths as the patient isn't actually breathing. Whether or not the heart is beating when it starts is case dependent. But if you are agonal breathing you will not be conscious to be aware that you're doing it.