To properly time any disarming technique you must understand "time in motion"—both yours and his—or how a body instinctively reacts to a stimulus. As you close the distance to the gunman, try to cant your body to the suspect's right side off the threat line (similar to all sound defensive tactics), not directly in front of him.
As you simultaneously close on the suspect to deliver your right knee strike, secure his right reaching arm just above his wrist with your left arm. Immediately, cinch your grip to create a strong vise grip on his gun arm. Wrench his shoulder forward and up to assert dominant control.
Note: If you miss grabbing his reach arm, by design you are still in position to jam and control his shoulder with your torso to prevent him deploying a weapon against you. This is also why the combined Police Krav Maga's bedrock principle of defense and distract/attack is so important: you must distract (and debilitate in a deadly force encounter) him as soon as possible to gain control.
With your right arm as you close and knee him, you may also slam him simultaneously in his carotid or simply secure him by the shoulder. When you deliver the powerful knee strike, it will usually drop his level. As you gain control of his arm, slam the top of your right forearm (radial bone) into the crook of the assailant's right elbow to fold it forcefully inward to facilitate a control often known as a kimura hold. Stab your right arm through the opening between his right arm and his torso to cinch the shoulder lock. Keep the assailant's right arm decisively pinned against your torso to firmly control it. Prepare to take him down to the ground. (Note: Another defensive option is to kick the would-be assailant in the groin and then close on him, however, this type of kick with its associated footwork requires extensive training.)
While asserting dominant control, forcefully drive the assailant to the ground at your two o'clock (not your twelve o'clock as he might try to roll on you). As you take down the assailant, be sure to keep his torso close to your torso to prevent any attempt to roll away from you as you drive him to the ground.