processmessages

How Can I Minimize Overhead when Processing Messages in a Long Loop

I've got some long but simple loops in my Delphi program that may loop millions of times and take some seconds to execute. The code inside of the loop is very fast and has been optimized. It just takes long because it is done so many times. e.g.: Screen.Cursor = crHourGlass; R := FirstRecord; while R <> nil do begin { do something si...