If you decide to hit the gym in hopes that a quick dose of exercise will cure your insomnia, a new study suggests that will not be enough.

While adopting an exercise program did ultimately help some insomniacs sleep better, the scientists found the effect was far from immediate.

"Where the idea to explore this came from is that my patients were coming in and saying that they heard that exercise is good for sleep," explained study author Kelly Baron, director of the Behavioral Sleep Medicine Program with the Feinberg School of Medicine at Northwestern University in Chicago. "But people generally want a quick fix. And they weren't seeing improvements right way. So, they were getting discouraged," she said.

"The message here is that exercise is not a quick fix, which I don't really think is discouraging at all," Baron said. "Our previous work found that exercise over a 16-week period is very effective in promoting sleep, on par with any kind of medication. But like with weight loss or any sort of behavioral change, it doesn't happen immediately. You have to measure progress over months, not day-to-day."

Baron and her colleagues published their latest findings online Aug. 15 in the Journal of Clinical Sleep Medicine.

Read more from U.S. News.