Safety Note: Talk to your doctor before making any big change in your exercise plan.

Morning exercisers will tell you how great it feels to finish a run before work, and evening exercisers will say a workout is a great stress reliever after a long day. So, which is best for you? Whether it’s 5 a.m. or 5 p.m., the best time to get physical is when you can fit it into your schedule. Doing regular physical activity is the first step toward a healthier you, says Jennifer Fassbender, MS, ACSM-CEP, a clinical exercise physiologist in Philadelphia.

For people with diabetes, exercise improves blood glucose control and insulin sensitivity, reduces cardiovascular disease risk factors, contributes to weight loss, promotes well-being, and increases muscle strength, according to a November 2016 position statement from the American Diabetes Association. And regular exercise can delay or prevent diabetes-related complications, including heart disease, diabetic retinopathy, and kidney disease, says Avigdor Arad, MA, RDN, ACSM, EP-C, a clinical exercise physiologist at the Obesity and Metabolic Research Unit at Mount Sinai St. Luke’s Hospital in New York.

Morning Highs

Early-morning workouts, done before breakfast, may be better for some people, especially those on insulin or sulfonylureas (which can lead to hypoglycemia) or for people who often go low during exercise, says David Weingard, 53, a type 1 triathlete and CEO and founder of Fit4D in New York.

Here’s why: In the morning, before your breakfast bolus and meal, only basal insulin is circulating in your body, and the levels will generally be low. Without the glucose-lowering effect of rapid-acting insulin from breakfast, your risk for exercise-induced hypoglycemia decreases, says Fassbender. And you may have higher blood glucose levels in the morning anyway—your body releases hormones such as cortisol and growth hormone while you sleep, which reduce sensitivity to insulin and increase glucose production in the liver. This is known as the dawn phenomenon, and it can also keep your blood glucose stable during pre-breakfast exercise. You may even consider reducing your breakfast bolus after activity to avoid lows several hours later, says Fassbender.

But there are times you’ll want to eat breakfast before morning activity. For instance, if your fasting blood glucose is low when you wake up, then you do need to eat breakfast and bolus before exercise. That dose can be slightly smaller than normal to account for the duration and intensity of your intended workout. Talk with your health care provider before making exercise-related adjustments to your insulin or medications.

For people with type 2 who aren’t on insulin, morning exercise may slightly increase glucose levels if breakfast was skipped. One study that looked at morning exercisers with type 2 found that if they didn’t eat before the activity, the workout promoted the release of more glucose-raising hormones, leading to more glucose in the bloodstream at first and a moderate decrease later in the workout. But if they ate before the activity, it caused their bodies to release insulin, which halted those overnight insulin-resistant hormones and brought the glucose level down more significantly, says Fassbender.

Meal Matters

Exercise can successfully be timed around meals, but the ideal timing is different for people on insulin than for those who are not.

Before Meals

If you exercise when you don’t have a new dose of short- or rapid-acting insulin in your system, you can reduce your chances of going low. That’s why pre-meal exercise is often a good choice for people who use basal-bolus insulin. Rapid-acting insulin from a previous meal will likely have worn off by the time you work out, which can help you avoid lows. And exercising before meals can have other benefits: You may see lower blood glucose levels after you eat, says Arad, which means post-meal spikes won’t be quite as high.

After Meals

For people not on insulin, moderate exercise after eating is “very helpful in managing against the rise in glucose post-meal,” says Fassbender. An October 2016 study published in the journal Diabetologia found that walking 10 minutes right after each meal, as opposed to walking 30 minutes at another time, improved post-meal glucose levels. Of course, walking 30 minutes at another time is still good for you.

Moderate exercise after meals takes some preparation for insulin users and for those on medications that can increase insulin secretion. Because rapid-acting insulin peaks 90 to 120 minutes after injection and lasts three to four hours, mealtime boluses can cause hypoglycemia when coupled with exercise after the meal. “You can plan ahead and adjust the insulin dose prior to the [meal] so that you’re a little bit higher than you usually are to allow for the blood glucose–lowering effects of the exercise,” says Fassbender. Typically, it’s the rapid-acting bolus insulin that needs to be adjusted, she says, but basal (background) doses may also need to be reduced for regular exercisers. If you use sulfonylureas, know they are most active in the two hours after you take them, says Arad, so it’s best to wait a couple hours to exercise, though lows can occur at any time when taking these meds.

Evening Lows

Insulin users should be careful about exercising within one hour of bedtime, says Richard Peng, MS, RCEP, CDE, a clinical exercise physiologist at the HealthCare Partners Medical Group in Los Angeles. After a bout of exercise, your blood glucose will continue to go down faster than normal. That’s because exercise causes your muscles to use stored glucose, says Peng.

This can leave you vulnerable to lows in the middle of the night, when you’re not awake to treat with 15 grams of fast-acting carbohydrate. According to the Association’s position statement, exercise-induced hypoglycemia typically occurs within six to 15 hours after exercise, but it can happen up to 48 hours later. Exercising for a long period of time (say, by running a marathon) can lead to insulin sensitivity for many hours afterward—and that ups the risk for nighttime, or even next-day, lows.

For extra safety after exercising, right before you go to sleep, have a bedtime snack, such as an apple with peanut butter, and set an alarm to check your glucose during the night. If you use a CGM, you may want to set higher low-glucose threshold alerts after evening exercise to get an earlier warning of decreasing blood glucose.

Be Prepared

As you get into an exercise routine, or intensify your activity, you should always keep emergency essentials on hand. These include a medical ID tag, glucose tablets, water, and, if you are at risk of going low, a workout buddy. “The whole point is to try and prepare the best you can,” says Fassbender. Do that, and you can hit the gym with confidence.

Safety Precautions

Check Ketones.

For those on a basal and bolus insulin regimen: If your blood glucose is 250 mg/dl or above, check for ketones. If moderate to large amounts of ketones are present (greater than or equal to 1.5 mmol/L), avoid exercising. “You need to postpone activity until you get those numbers down and there are no ketones,” says Jennifer Fassbender, MS, ACSM-CEP, a Philadelphia-based clinical exercise physiologist. If your level is over 250 mg/dl but you don’t have ketones, she says, moderate activity is fine. But avoid intensive activity as this could raise blood glucose more.

Stay hydrated.

Dehydration can contribute to high blood glucose. And because high blood glucose can cause more urine to be excreted from the body, it can cause dehydration, too, says Fassbender. Dehydration can also make it hard for your body to regulate its temperature, which puts you at a greater risk for heat illness.

Exercise Goals

The American Diabetes Association recommends:

At least 150 minutes of moderate to vigorous activity or 75 minutes of vigorous exercise or interval training weekly, spread out over three days during the week.

Two to three sessions of strength training each week on nonconsecutive days, and no more than two consecutive days without activity.