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


There are some long, but simple edges in my Delphi program, which can loop millions of times and execute a few seconds.

The code inside the loop is very fast and it has been optimized. It takes a lot of time because it is done many times.

Example:

  Screen.Cursor = crHourGlass; R: = FirstRockord; While R & lt; & Gt; Starting zero is something easy to do with R.Value} R: = R.NextRecord; End; Screen. Cursor: = crDefault;  

Now I do not want my program to be unresponsive, so I want to add an application. Processes inside the message loop But I also want to add details to slow down my loop as low as possible.

I am following a linked list, so I also do not have a counting variable available and I have to add one to the desired interval or add a timer, but there is a need to reduce the timing check .

How do I add it to which the overhead has been added?


Conclusion:

For now, I am doing something like the reply of APJ 28.

But it seems that I should implement some sort of threading to handle this type of handle. Thank you for paying attention to this, because I thought the application. Processing message was the only way to do this.

To free the main thread for processing GUI loop, loop in a thread Can be inserted.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -