<?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[Ausgabe von &amp;quot;arbeite noch&amp;quot;-Meldung in einer Schleife]]></title><description><![CDATA[<p>Hi</p>
<p>Ich habe hier eine while-Schleife in der *ziemlich* viele Durchläufe passieren. Die Ausführungszeit liegt im Bereich von Minuten.<br />
Ich würde gern so alle 10 bis 20sek eine Ausgabe erzeugen a la &quot;Ich leben noch&quot; auf cout.<br />
Einen Counter hochzählen und ihn in jedem Durchlauf zu prüfen, ob er modulo wasweissich == 0 ist erscheint mir angesichts der dafür in jedem durchgang nötigen abfrage eigentlich unschön/uneffizient.</p>
<p>Kennt jemand einen anderen, eleganteren Weg ?</p>
<p>Danke !</p>
<p>Benjamin</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/139822/ausgabe-von-quot-arbeite-noch-quot-meldung-in-einer-schleife</link><generator>RSS for Node</generator><lastBuildDate>Mon, 31 Aug 2026 06:57:11 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/139822.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 09 Mar 2006 15:47:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ausgabe von &amp;quot;arbeite noch&amp;quot;-Meldung in einer Schleife on Thu, 09 Mar 2006 15:47:35 GMT]]></title><description><![CDATA[<p>Hi</p>
<p>Ich habe hier eine while-Schleife in der *ziemlich* viele Durchläufe passieren. Die Ausführungszeit liegt im Bereich von Minuten.<br />
Ich würde gern so alle 10 bis 20sek eine Ausgabe erzeugen a la &quot;Ich leben noch&quot; auf cout.<br />
Einen Counter hochzählen und ihn in jedem Durchlauf zu prüfen, ob er modulo wasweissich == 0 ist erscheint mir angesichts der dafür in jedem durchgang nötigen abfrage eigentlich unschön/uneffizient.</p>
<p>Kennt jemand einen anderen, eleganteren Weg ?</p>
<p>Danke !</p>
<p>Benjamin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1012585</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1012585</guid><dc:creator><![CDATA[Benja_m]]></dc:creator><pubDate>Thu, 09 Mar 2006 15:47:35 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgabe von &amp;quot;arbeite noch&amp;quot;-Meldung in einer Schleife on Thu, 09 Mar 2006 15:49:34 GMT]]></title><description><![CDATA[<p>Also wenn Du keine Möglichkeit hast die Schleife in nen Thread auszulagern auf den von aussen gewartet wird, hast Du keine andere Möglichkeit als hin und wieder während des Schleifendurchlaufs ne Ausgabe zu machen.</p>
<p>Daraus folgt logischerweise dass Du bei JEDEM Schleifendurchlauf eine Abfrage machen musst (Code der &quot;vielleicht&quot; ausgeführt wird gibt es nur in Java2K <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> ). Ob Du dabei einen Zähler modulo X oder einen Zeitwert überprüfst ist dann ziemlich schnuppe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1012588</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1012588</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Thu, 09 Mar 2006 15:49:34 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgabe von &amp;quot;arbeite noch&amp;quot;-Meldung in einer Schleife on Thu, 09 Mar 2006 15:55:40 GMT]]></title><description><![CDATA[<p>die möglichkeit mit dem thread habe ich - aber nicht die fähigkeit <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>sowas hab ich noch nie gemacht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1012596</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1012596</guid><dc:creator><![CDATA[Benja_m]]></dc:creator><pubDate>Thu, 09 Mar 2006 15:55:40 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgabe von &amp;quot;arbeite noch&amp;quot;-Meldung in einer Schleife on Thu, 09 Mar 2006 15:56:43 GMT]]></title><description><![CDATA[<p>es gibt immer ein erstes mal .. oder etwa nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";-)"
      alt="😉"
    /></p>
<p>gruessle</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1012597</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1012597</guid><dc:creator><![CDATA[TDO]]></dc:creator><pubDate>Thu, 09 Mar 2006 15:56:43 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgabe von &amp;quot;arbeite noch&amp;quot;-Meldung in einer Schleife on Thu, 09 Mar 2006 16:31:56 GMT]]></title><description><![CDATA[<p>Benja_m schrieb:</p>
<blockquote>
<p>die möglichkeit mit dem thread habe ich - aber nicht die fähigkeit <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>sowas hab ich noch nie gemacht.</p>
</blockquote>
<p>Wenn du Programmieren willst musst du auch dafür Fähigkeiten haben, oder sie dir beibringen.<br />
Alternativ kannst du natürlich auch den Timer vom Betriebsystem auslesen und alle drei Sekunden eine Meldung raushauen:</p>
<p>!Pseudocode!</p>
<pre><code class="language-cpp">t1 = getTime(); 
//blablalba
t2 = getTime();

if ( t2 - t1 &gt; deinegewünschtezeit )
  std::cout &lt;&lt; &quot;meldung\n&quot;;
</code></pre>
<p>grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1012620</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1012620</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Thu, 09 Mar 2006 16:31:56 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgabe von &amp;quot;arbeite noch&amp;quot;-Meldung in einer Schleife on Fri, 10 Mar 2006 08:41:40 GMT]]></title><description><![CDATA[<p>Schau mal in Boost Library rein, da gibts sowohl Threads als auch Timer. Letzteres stellt eine Art Progressbar für die Konsole bereit.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1013028</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1013028</guid><dc:creator><![CDATA[Artchi]]></dc:creator><pubDate>Fri, 10 Mar 2006 08:41:40 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgabe von &amp;quot;arbeite noch&amp;quot;-Meldung in einer Schleife on Fri, 10 Mar 2006 10:23:36 GMT]]></title><description><![CDATA[<p>David_pb schrieb:</p>
<blockquote>
<p>Benja_m schrieb:</p>
<blockquote>
<p>die möglichkeit mit dem thread habe ich - aber nicht die fähigkeit <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>sowas hab ich noch nie gemacht.</p>
</blockquote>
<p>Wenn du Programmieren willst musst du auch dafür Fähigkeiten haben, oder sie dir beibringen.</p>
</blockquote>
<p>natürlich, deswegen der <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> hinter meiner aussage (nennen wir es mal faulheit :))</p>
<p>David_pb schrieb:</p>
<blockquote>
<p>Alternativ kannst du natürlich auch den Timer vom Betriebsystem auslesen und alle drei Sekunden eine Meldung raushauen:</p>
<p>!Pseudocode!</p>
<pre><code class="language-cpp">t1 = getTime(); 
//blablalba
t2 = getTime();

if ( t2 - t1 &gt; deinegewünschtezeit )
  std::cout &lt;&lt; &quot;meldung\n&quot;;
</code></pre>
</blockquote>
<p>naja, da kann ich dann aber auch meinen Counter benutzen, kommt aufs selbe hinaus <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Trotzdem danke !</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1013117</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1013117</guid><dc:creator><![CDATA[Benja_m]]></dc:creator><pubDate>Fri, 10 Mar 2006 10:23:36 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgabe von &amp;quot;arbeite noch&amp;quot;-Meldung in einer Schleife on Fri, 10 Mar 2006 10:24:46 GMT]]></title><description><![CDATA[<p>Artchi schrieb:</p>
<blockquote>
<p>Schau mal in Boost Library rein, da gibts sowohl Threads als auch Timer. Letzteres stellt eine Art Progressbar für die Konsole bereit.</p>
</blockquote>
<p>Danke, werd es mal hiermit probieren:<br />
<a href="http://www.boost.org/libs/timer/" rel="nofollow">http://www.boost.org/libs/timer/</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1013120</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1013120</guid><dc:creator><![CDATA[Benja_m]]></dc:creator><pubDate>Fri, 10 Mar 2006 10:24:46 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgabe von &amp;quot;arbeite noch&amp;quot;-Meldung in einer Schleife on Fri, 10 Mar 2006 13:09:26 GMT]]></title><description><![CDATA[<p>Ich denke simpler wäre umformulieren in der folgenden Art:<br />
aus</p>
<pre><code>for( int i= 0; i &lt; e; ++i )
{
    blubb();
}
</code></pre>
<p>wird:</p>
<pre><code>for( int i= 0; i &lt; e; ++i )
{
    int e2= min( i + zahl, e )
    for( ; i &lt; e2; ++i )
    {
        blubb();
    }
    std::cout &lt;&lt; &quot;alive&quot;;
}
</code></pre>
<p>Bye, TGGC (<a href="http://tggc.tg.funpic.de/index.php" rel="nofollow">Das Jahr des Helden</a>)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1013271</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1013271</guid><dc:creator><![CDATA[TGGC]]></dc:creator><pubDate>Fri, 10 Mar 2006 13:09:26 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgabe von &amp;quot;arbeite noch&amp;quot;-Meldung in einer Schleife on Fri, 17 Mar 2006 13:05:53 GMT]]></title><description><![CDATA[<p>*rauskram*</p>
<p>TGGC schrieb:</p>
<blockquote>
<p>Ich denke simpler wäre umformulieren in der folgenden Art:</p>
<pre><code>for( int i= 0; i &lt; e; ++i )
{
    int e2= min( i + zahl, e )
    for( ; i &lt; e2; ++i )
    {
        blubb();
    }
    std::cout &lt;&lt; &quot;alive&quot;;
}
</code></pre>
</blockquote>
<p>Wie stelle ich das an, wenn ich als Ausgangspunkt eine while-Schleife habe, die auf einen wert schaut, der in ihr geändert wird ?<br />
da fällt mir dann wieder nur der umweg über eine zählervariable ein <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1018263</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1018263</guid><dc:creator><![CDATA[Benja_m]]></dc:creator><pubDate>Fri, 17 Mar 2006 13:05:53 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgabe von &amp;quot;arbeite noch&amp;quot;-Meldung in einer Schleife on Fri, 17 Mar 2006 13:14:53 GMT]]></title><description><![CDATA[<p>die while- als for-schleife(n) umschreiben !?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1018280</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1018280</guid><dc:creator><![CDATA[bumbytie]]></dc:creator><pubDate>Fri, 17 Mar 2006 13:14:53 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgabe von &amp;quot;arbeite noch&amp;quot;-Meldung in einer Schleife on Fri, 17 Mar 2006 13:25:56 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">int ret = 0;
while (ret == 0) {
    ...
    ret = blub();
    ...
}
</code></pre>
<p>so is meine schleife. komme grad nicht drauf, wie ich das in eine for-schleife packen soll ... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /><br />
vielleicht isses zu einfach ? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1018289</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1018289</guid><dc:creator><![CDATA[Benja_m]]></dc:creator><pubDate>Fri, 17 Mar 2006 13:25:56 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgabe von &amp;quot;arbeite noch&amp;quot;-Meldung in einer Schleife on Fri, 17 Mar 2006 13:30:49 GMT]]></title><description><![CDATA[<p>Würde mir spontan auch nix besseres zu einfallen als</p>
<pre><code class="language-cpp">int ret = 0;
while (ret == 0) {
    for (int i = 0; ret == 0 &amp;&amp; i &lt; 100; ++i) {
        ...
        ret = blub();
        ...
    }
    cout &lt;&lt; &quot;alive!&quot; &lt;&lt; endl;
}
</code></pre>
<p>Was auch über nen Zähler ist, nur anders implementiert...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1018292</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1018292</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Fri, 17 Mar 2006 13:30:49 GMT</pubDate></item></channel></rss>