The initial phase of the collapse of a gas cloud takes a few million years for a typical free-fall speed of 10 kilometers per second and a core size of about 1 parsec. Ballpark estimate.