How fast do the F-35 weapons bay doors open/close during combat ops?
3-4 seconds may lead to a detection, but then again 1-2 seconds could too with a sophisticated radar system. The important thing is that 3-4 seconds is short enough that a detection would be extremely hard to exploit; by the time a missile could be launched the contact would have disappeared. 

If by some chance a station managed to get a missile off in that short time-frame it would probably miss. There are 2 types of radar guided missiles:


Semi-Active radar homing: semi-active missiles only have a radar receiver, they home in on a target using radar painted by a ground station or airborne radar. If the targeting radar station loses lock then the missile will go wide
Active radar homing: active missiles have their own radar emitters which get switched on when they get close to their target, so they are no longer relying on the ground station which is much farther away. They still rely on the ground station to get close enough to use it though, so while active missiles have a better chance it's still very unlikely


So shaving a second off that time would give very little benefit. Having a door open longer would be bad though. In the book "Skunk Works" by Ben Rich and Leo Janos (former director of the Lockheed Skunk Works) Major Miles Pound wrote about his experiences in the first Iraq war flying an F117 when a bomb bay door got stuck open after dropping:


  We came in at three in the morning using only eight airplanes and
  needing only two tankers to get us there and back, and took out three
  of the four nuclear reactors and heavily damaged the fourth. Once that
  first bomb hit all hell broke loose. I dropped my bombs, but I
  couldn’t get my bomb-bay door closed. That was as bad as it could get
  because a right angle is like a spotlight to ground radar and
  a bomb-bay door is a perfect right angle. And out of the corner of my
  eye I saw a missile firing up at me. I had one hand on the eject lever
  and the other trying to manually close that stalled bomb bay. As the
  missile closed on me, the door finally did, too, and I watched that
  missile curve harmlessly by me as it lost me in its homing. About an
  hour later I began breathing again.