<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[warten ohne Prozessor Auslastung?]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich muss eine Liste von Ereignissen abarbeiten. Es kann vorkommen, dass ich<br />
dazwischen etwas warten muss (mal eine Minute, mal eine Stunde).</p>
<p>Bisher mach ich das in etwa so:</p>
<pre><code class="language-cpp">int iWaitTime = 1000000;
int iStartTime = GetTickCount();
while (iStartTime + iWaitTime &gt; GetTickCount) {
    Application-&gt;ProcessMessages();
}
</code></pre>
<p>ich hab alle Knöpfe die man nicht drücken darf gesperrt, darum kann ich<br />
eigentlich ohne Probleme das Application-&gt;ProcessMessages() verwenden.</p>
<p>Leider wird im TaskManager eine Auslastung von 100% angezeigt.<br />
Ist es möglich das zu ändern, damit der Prozessor beim &quot;nichts tun&quot; nicht<br />
so stark ausgelastet ist?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/79790/warten-ohne-prozessor-auslastung</link><generator>RSS for Node</generator><lastBuildDate>Tue, 30 Jun 2026 03:27:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/79790.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 14 Jul 2004 14:03:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to warten ohne Prozessor Auslastung? on Wed, 14 Jul 2004 14:03:42 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich muss eine Liste von Ereignissen abarbeiten. Es kann vorkommen, dass ich<br />
dazwischen etwas warten muss (mal eine Minute, mal eine Stunde).</p>
<p>Bisher mach ich das in etwa so:</p>
<pre><code class="language-cpp">int iWaitTime = 1000000;
int iStartTime = GetTickCount();
while (iStartTime + iWaitTime &gt; GetTickCount) {
    Application-&gt;ProcessMessages();
}
</code></pre>
<p>ich hab alle Knöpfe die man nicht drücken darf gesperrt, darum kann ich<br />
eigentlich ohne Probleme das Application-&gt;ProcessMessages() verwenden.</p>
<p>Leider wird im TaskManager eine Auslastung von 100% angezeigt.<br />
Ist es möglich das zu ändern, damit der Prozessor beim &quot;nichts tun&quot; nicht<br />
so stark ausgelastet ist?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/560531</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/560531</guid><dc:creator><![CDATA[Acidmrp]]></dc:creator><pubDate>Wed, 14 Jul 2004 14:03:42 GMT</pubDate></item><item><title><![CDATA[Reply to warten ohne Prozessor Auslastung? on Wed, 14 Jul 2004 14:15:05 GMT]]></title><description><![CDATA[<p>Sleep(ZeitinMillisekunden);</p>
]]></description><link>https://www.c-plusplus.net/forum/post/560548</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/560548</guid><dc:creator><![CDATA[F98]]></dc:creator><pubDate>Wed, 14 Jul 2004 14:15:05 GMT</pubDate></item><item><title><![CDATA[Reply to warten ohne Prozessor Auslastung? on Wed, 14 Jul 2004 14:26:06 GMT]]></title><description><![CDATA[<p>Also ich würde kein Sleep() nehmen weil</p>
<p>BCB-Hilfe schrieb:</p>
<blockquote>
<p>You have to be careful when using Sleep and DDE. If a thread creates any windows, it must process messages. DDE sends messages to all windows in the system. If you have a thread that uses a wait function with no time-out interval, the system will deadlock. Therefore, if you have a thread that creates windows, use <strong>MsgWaitForMultipleObjects</strong> or <strong>MsgWaitForMultipleObjectsEx</strong>, rather than Sleep.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/560566</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/560566</guid><dc:creator><![CDATA[PuppetMaster2k]]></dc:creator><pubDate>Wed, 14 Jul 2004 14:26:06 GMT</pubDate></item><item><title><![CDATA[Reply to warten ohne Prozessor Auslastung? on Wed, 14 Jul 2004 16:29:24 GMT]]></title><description><![CDATA[<p>Wie wäre es wenn Du Application-&gt;ProcessMessages nicht so oft aufrufen würdest. Ich würde es nur jeden 500en Durchlauf in der while-Schleife ausführen. (einfach ausprobieren bei welchem Wert die Anwendung bedienbar bleibt, aber die CPU-Last sinkt).</p>
<p>Ansonsten, hast Du Dir schonmal TTimer angesehen. Klingt irgenwie als wäre er für Deine Aufgabe prädestiniert. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/560683</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/560683</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 14 Jul 2004 16:29:24 GMT</pubDate></item><item><title><![CDATA[Reply to warten ohne Prozessor Auslastung? on Wed, 14 Jul 2004 18:39:28 GMT]]></title><description><![CDATA[<p>Danke für die Antworten:</p>
<pre><code class="language-cpp">ShowMessage(&quot;Start&quot;);
MsgWaitForMultipleObjects(1,NULL,1, 10000, QS_TIMER);
ShowMessage(&quot;Ende&quot;);
</code></pre>
<p>ist genau das was ich gesucht habe. Gut damit wird die Form nichtmehr<br />
geupdated, aber das kann ich ja alle 100 millisekunden selber machen.</p>
<p>Ein Timer ist denkbar unpraktisch für meine Anwendung. Ich schreibe<br />
etliche Befehle in eine Liste und führe diese aus. Wenn nun ein Befehl<br />
&quot;warten&quot; ist will ich einfach an dieser Stelle eine weile warten.<br />
Bzw. übernimmt das warten eine dll.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/560786</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/560786</guid><dc:creator><![CDATA[Acidmrp]]></dc:creator><pubDate>Wed, 14 Jul 2004 18:39:28 GMT</pubDate></item></channel></rss>