>>531117559
have an integer when each one is active and then wait a frame if the number of active units is bigger than something like MAX_UNITS_PER_FRAME.