I have researched previous post and did not find the answer to this. If, when the check engine light comes on and it is only a loose gas cap, how long till the light goes out?

Noticed the light and had 1/2 tank of gas. Filled up and replaced the cap...light still on. VX still runs great, no sounds, stutters, shakes....

Darrin