It depends on what caused the swimbladder to begin with.
I do not feed my bettas at all if they develop swimbladder for 3-4 days, nor do I medicate them. After about four days I feed them the insides of a blanched pea. They do not have to be constipated for their food to cause swimbladder problems. If you are feeding pellets, they swell in the bettas stomach and will cause the problem until they are passed. The fish should be taken off pellets until the swimbladder is gone. And then they should only be fed to them if the pellets have been soaked in dechlorinated water for about 10 minutes prior to feeding, and a varied diet including things like FROZEN (not freeze-dried) bloodworms, daphina, brine shrimp, etc. will help cut down on swimbladder.
If the problem still persists after four days, look for another cause. It could be caused by an internal infection, or internal parasites filling up the abdomen and pushing against the swimbladder. You would have to determine the cause and use the necessary medications for either. In the case of parasites, the poo is usually long, white and stringy.
Finally, swimbladder can be permanent due to an injury. Even something as simple as rough netting during a water change can permanently damage a fish's swimbladder. If it is a permanent injury, it will not get any better, but with proper care, the fish can still live a long life. I have two that have permanent swimbladder damage, one about two years old and the other over a year old.