The problem isn't that your program is running too quickly; in fact it's running too slow. You're drawing 10,000,000 line segments and outputting 10,000,000 lines of text. Why do you think that would happen quickly?

This is probably a simulation of your expectation for some other lengthy operation. Chances are that the true lengthy operation is not as graphically intense as your simulation (and if it is, then you're doing it in the wrong place), or if it is graphically intense, that there are much better ways to do this (such as drawing into a bitmap, perhaps in a worker thread, where the bitmap is BitBlt'd to the screen in the OnPaint handler). If you tell us your true goals/objectives, perhaps we can suggest whether a worker thread or a message pump or some other architecture is better.

Mike