Pretty sure it varies depending on where you live. iirc When I was in SF the tickets would get distributed ahead of time and the sweeper would follow within an hour or so. Once the sweeper went by you were free to re-park.
In Oakland, there are different vehicles that come by for different purposes. As I understand it there’s an agitator, sprayer, and sweeper. You have to know when the whole process is complete, so I understand it’s easier just to avoid for the whole window.