Okay. I'm going to give the best amateur answer I can. We have some personal trainers who visit this board that will hopefully see your question and give you some expert advice.
Any activity helps, as Nicole said. So if five minutes is all you can do, doing it several times a day will help both your fitness level, your confidence in your ability to perform the task, and will burn calories. So - great job on putting the effort in, even if it was pretty frustrating.
For cardiovascular health, though, it is pretty important to push your heart rate to the "fat burning" zone and keep it there for a sustained period of time. This will also raise your metabolism for several hours after you're done working out - an incredible side benefit. The good news is that if you are out of shape, your heart rate will go higher with less effort than it takes someone who is in better shape, so don't be discouraged if you start out as one of the slowest at your gym. I have included a link to a calculator below so that you can figure out what your training zone heart rate is:
http://www.brianmac.co.uk/hrm1.htm
My best advice? Try your best to push through it if you can for as long as you can. I listen to music to distract me, and tell myself things like, "I am someone who thrives on challenges. I know I can do this!" As long as you're keeping the heart rate up, you don't have to go at it fast and furious. Work hard enough to keep the heart rate up without pushing yourself into quick exhaustion. In the beginning, you might want to turn down the resistance so that you can keep going longer.
I've got to tell you - most of the time I love the exercise part. But there are times, especially times when I've made mistakes with my eating, that I just don't feel like doing it. It is after those times, though, that I feel the best. I always get a post-work-out high, but they're even better when I know that I needed to show that extra mental toughness to get it in.
Let us know from time to time how you're managing to tame that treadmill into submission!