OpenGL Window Lag

I have a little problem.Sometimes when i move in the OpenGL scene,it just freezes for about 1-2 seconds and continues again.
If I put a Sleep(10); this doesn’t seem to happen,but without it it just stops,and then continues.
I’m using wgl on windows 7 x64

	while(1)
	{
		while(PeekMessage(&msgWindow,0,0,0,PM_REMOVE))
		{
			
			if(msgWindow.message == WM_QUIT)
				goto exit;

			TranslateMessage(&msgWindow);

			DispatchMessage(&msgWindow);
		}
                //RenderCode Here....
                glFlush();
                SwapBuffers(hDC);
                Sleep(10);

This is the message loop.I think that it may cause the problem

I’m not sure you should be putting the gl code inside your windows event handler.
What’s your Main() function doing?
What event handler do you have for windows paint?

Why do you flush the pipeline? (glFlush)
Did you try disabling Aero effect of Windows 7?

Uses wgl to make context,and makes a window.
I have nothing in WM_PAINT
//
Is it a bad thing to flush the pipeline ?