Quote:Original post by goodieAh, you didn't say CPU usage was up to 100%.
Thanks everyone for answers - I changed InvalidateRect TRUE to FALSE, but there was no change, so i guess i had a tight main loop, because when i put Sleep(5) in the loop the time taken decreases to 0-1%, which seems normal to me. Is the problem of tight loops usually solved with Sleep() or is there another approach?
You had what is called a "busy loop". Some form of yielding is required to reduce the CPU usage back to something sensible. Sleep(1) will do that just fine..