What's the timescale for the formation of a coronal mass ejection? How quickly does the sun form and release a coronal mass ejection?
If we were watching the right part of the sun closely, how long would it take us to go from "nothing seems to be happening" to "something's definitely happening", to "okay, any minute now", to "it happened, the CME has now separated from the rest of the sun"?
 A: Quick Background
I have taken some background from the following two answers:


*

*Solar Flares:  https://physics.stackexchange.com/a/258093/59023

*Coronal Mass Ejections (CMEs):  https://astronomy.stackexchange.com/a/16786/13663
First, there are several differences between solar flares and coronal mass ejections (CMEs).  CMEs involve large amounts (i.e., upwards of billions of tons) of matter (in the form of plasma) to leave the sun.  A solar flare is really described by the sudden enhancement of x-rays from a small region in the solar corona.  They can produce streams of high energy particles, called solar energetic particles or SEPs (CMEs can produce SEPs as well), but these are streams of magnetic field-aligned particles propagating away from the sun.  They can have energies up to ~GeV for ions and several ~MeV for electrons, but rarely higher.  Earth's atmosphere does a great job of shielding much of this and the surrounding magnetic field helps to "deflect" some of the incident particles as well.
Both phenomena start from what are called active regions on the sun, usually things like sunspots.
Answers

How quickly does the sun form and release a coronal mass ejection?

There is no easy/quick answer for this, as the actual drivers of CMEs can vary from the release of elongated prominences to localized eruptions.  The former can be relatively stable for days.

If we were watching the right part of the sun closely, how long would it take us to go from "nothing seems to be happening" to "something's definitely happening"

This can occur as quickly as the imaging cadence of SDO, i.e., 10s of seconds.  However, the this to which I refer is somewhat ambiguous.  What do you mean by "something is happening"?  There are nearly countless things occurring on the sun at any given time, even when the sun looks completely quiet.

"something's definitely happening", to "okay, any minute now"

Again, this is a little too ambiguous to properly answer but I can say that most drastic changes take anywhere from 10s of minutes to hours to days, depending on the event and the thing.

"okay, any minute now", to "it happened, the CME has now separated from the rest of the sun"?

It seems that the delay between flare ignition and CME ejecta can be as little as 10s of minutes or less [e.g., Salas-Matamoros and Klein, 2015], again depending on context and specifics.  It can also take hours to days, which may imply one did not directly affect/cause the other but sometimes they erupt from the same active region that caused the flare.  Again, the sun is very complicated and chaotic (yes, the mathematical defintion).
References


*

*Kozyra, J.U., et al., "Earth's collision with a solar filament on 21 January 2005: Overview," J. Geophys. Res. 118, pp. 5967–5978, doi:10.1002/jgra.50567, 2013.

*Möstl, C., et al., "Strong coronal channelling and interplanetary evolution of a solar storm up to Earth and Mars," Nature Comm. 6, pp. 7135, doi:10.1038/ncomms8135, 2015.

*Salas-Matamoros, C. and K.-L. Klein "On the Statistical Relationship Between CME Speed
and Soft X-Ray Flux and Fluence of the Associated Flare," Solar Phys. 290, pp. 1337–1353, doi:10.1007/s11207-015-0677-0, 2015.

