<?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[Programmdauer]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich schreibe gerade ein Programm, dass mir Primzahlen berechnet, und jetzt wollte ich wissen, wie ich eine Stoppuhr miteinbauen kann, die mir sagt, wenn das Programm fertig ist, wie lange es gebraucht hat.<br />
Danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/207067/programmdauer</link><generator>RSS for Node</generator><lastBuildDate>Sun, 11 Oct 2026 00:41:54 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/207067.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 03 Mar 2008 13:49:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Programmdauer on Mon, 03 Mar 2008 13:49:15 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich schreibe gerade ein Programm, dass mir Primzahlen berechnet, und jetzt wollte ich wissen, wie ich eine Stoppuhr miteinbauen kann, die mir sagt, wenn das Programm fertig ist, wie lange es gebraucht hat.<br />
Danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1467306</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1467306</guid><dc:creator><![CDATA[progerchris]]></dc:creator><pubDate>Mon, 03 Mar 2008 13:49:15 GMT</pubDate></item><item><title><![CDATA[Reply to Programmdauer on Mon, 03 Mar 2008 13:56:35 GMT]]></title><description><![CDATA[<p>Schau dir den Header ctime an (<a href="http://www.cppreference.com/stddate/index.html" rel="nofollow">http://www.cppreference.com/stddate/index.html</a>).<br />
Wenn du unter Linux arbeitest, Programm als Argument an time übergeben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1467315</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1467315</guid><dc:creator><![CDATA[Fellhuhn]]></dc:creator><pubDate>Mon, 03 Mar 2008 13:56:35 GMT</pubDate></item><item><title><![CDATA[Reply to Programmdauer on Mon, 03 Mar 2008 15:08:38 GMT]]></title><description><![CDATA[<p>Hallo !</p>
<p>Eine Möglichkeit:</p>
<pre><code class="language-cpp">#include &lt;time.h&gt;
start = clock();
// ... dein Programm ...
stop = clock();
// Dauer in Sekunden
dauer = (double)(stop - start) / CLOCKS_PER_SEC;
</code></pre>
<p>Für größere Zeitspannen, wenn dein Programm z.B. viele Stunden/Tage läuft, kannst du auch die Funktion time benutzen.<br />
Die Funktion difftime kann dir dann die verstrichene Zeit liefern.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1467375</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1467375</guid><dc:creator><![CDATA[proggingmania]]></dc:creator><pubDate>Mon, 03 Mar 2008 15:08:38 GMT</pubDate></item><item><title><![CDATA[Reply to Programmdauer on Mon, 03 Mar 2008 15:20:19 GMT]]></title><description><![CDATA[<p>oder boost::date_time <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="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1467388</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1467388</guid><dc:creator><![CDATA[Airdamn]]></dc:creator><pubDate>Mon, 03 Mar 2008 15:20:19 GMT</pubDate></item><item><title><![CDATA[Reply to Programmdauer on Mon, 03 Mar 2008 16:06:01 GMT]]></title><description><![CDATA[<p>Oder direkt <a href="http://www.boost.org/libs/timer/timer.htm" rel="nofollow">Boost.Timer</a> <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1467423</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1467423</guid><dc:creator><![CDATA[.filmor]]></dc:creator><pubDate>Mon, 03 Mar 2008 16:06:01 GMT</pubDate></item><item><title><![CDATA[Reply to Programmdauer on Mon, 03 Mar 2008 16:37:01 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;ctime&gt;

int main()
{
    const std::clock_t start_time(std::clock());
    // TODO: Your Programm ...

    const double douration((std::clock() - start_time) / CLOCKS_PER_SEC);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1467440</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1467440</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Mon, 03 Mar 2008 16:37:01 GMT</pubDate></item><item><title><![CDATA[Reply to Programmdauer on Mon, 03 Mar 2008 19:19:20 GMT]]></title><description><![CDATA[<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1467536</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1467536</guid><dc:creator><![CDATA[progerchris]]></dc:creator><pubDate>Mon, 03 Mar 2008 19:19:20 GMT</pubDate></item></channel></rss>