<?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[Zeitmess problem]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe ein Problem beim messen von Berechnugszeiten<br />
die funktion low_pass_filter filtert ein bild, und um herauszufinden wie lange es dauert nehme ich die clock() function, das ganze soll gemittelt werden über alle durchläufe, daher muss ich ein array mit number of runs zuerst befülllen</p>
<p>Code folgt:</p>
<pre><code class="language-csharp">float * calc_pc_tot = (float*)malloc(sizeof(float)*NUMBER_OF_RUNS);
for(int i = 0; i &lt; NUMBER_OF_RUNS;i++){
		unsigned int start = clock();
		low_pass_filter(3,data,data_ref, Width, Height);
		unsigned int stop = clock();
		calc_pc_tot[i] = (float)(stop-start);
                printf(&quot;host: %f millisec \n&quot;,calc_pc_tot[i]);
}
</code></pre>
<p>Das Probelm dabei ist dass er einmal einen vernünftigen Wert 16 millisec und jeden 2ten wert auf 0 setzt</p>
<p>also ca so</p>
<p>16,0,16,0,16,0,16,0,16,0....</p>
<p>ich bin ratlos, hat jemand vielleicht ienne Einfall??<br />
Lg<br />
Maz</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/257914/zeitmess-problem</link><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 18:42:49 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/257914.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 04 Jan 2010 19:40:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zeitmess problem on Mon, 04 Jan 2010 19:44:30 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe ein Problem beim messen von Berechnugszeiten<br />
die funktion low_pass_filter filtert ein bild, und um herauszufinden wie lange es dauert nehme ich die clock() function, das ganze soll gemittelt werden über alle durchläufe, daher muss ich ein array mit number of runs zuerst befülllen</p>
<p>Code folgt:</p>
<pre><code class="language-csharp">float * calc_pc_tot = (float*)malloc(sizeof(float)*NUMBER_OF_RUNS);
for(int i = 0; i &lt; NUMBER_OF_RUNS;i++){
		unsigned int start = clock();
		low_pass_filter(3,data,data_ref, Width, Height);
		unsigned int stop = clock();
		calc_pc_tot[i] = (float)(stop-start);
                printf(&quot;host: %f millisec \n&quot;,calc_pc_tot[i]);
}
</code></pre>
<p>Das Probelm dabei ist dass er einmal einen vernünftigen Wert 16 millisec und jeden 2ten wert auf 0 setzt</p>
<p>also ca so</p>
<p>16,0,16,0,16,0,16,0,16,0....</p>
<p>ich bin ratlos, hat jemand vielleicht ienne Einfall??<br />
Lg<br />
Maz</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1832480</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1832480</guid><dc:creator><![CDATA[mazzok]]></dc:creator><pubDate>Mon, 04 Jan 2010 19:44:30 GMT</pubDate></item><item><title><![CDATA[Reply to Zeitmess problem on Mon, 04 Jan 2010 19:46:47 GMT]]></title><description><![CDATA[<p>Der Standardzeitmesser ist leider nicht sehr genau aufgelöst. Zwei Möglichkeiten: Du machst viel mehr Durchläufe zwischen Start und Stopp und mittelst dann. Oder du nennst uns dein Betriebssystem, dann nennt dir (hoffentlich) jemand der sich damit auskennt Möglichkeiten einen feineren Zeitmesser zu benutzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1832482</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1832482</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 04 Jan 2010 19:46:47 GMT</pubDate></item><item><title><![CDATA[Reply to Zeitmess problem on Mon, 04 Jan 2010 20:02:10 GMT]]></title><description><![CDATA[<p>ich benutze win 7 prof edition 64bit!</p>
<p>aber was ich icht genau verstehe, wieso er einmal 0 und einmal 16 sein soll<br />
das spricht eher dafür dass jeder durchgang 8 msec braucht..<br />
seltsam, das ist doch nicht asynchron?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1832494</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1832494</guid><dc:creator><![CDATA[mazzok]]></dc:creator><pubDate>Mon, 04 Jan 2010 20:02:10 GMT</pubDate></item><item><title><![CDATA[Reply to Zeitmess problem on Mon, 04 Jan 2010 20:13:16 GMT]]></title><description><![CDATA[<p>Der Timer wird wohl alle 16 ms einen Schritt weiter gestellt. Deine Funktion braucht anscheinend ungefähr 8 ms, daher findet dies nur bei jedem zweiten Durchlauf statt und bei den anderen Läufen hast du vorher und nachher den gleichen Wert, weil der Timer zwischendurch nicht geändert wurde.</p>
<p>Mit Windowsprogrammierung kenne ich mich leider nicht aus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1832500</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1832500</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 04 Jan 2010 20:13:16 GMT</pubDate></item><item><title><![CDATA[Reply to Zeitmess problem on Mon, 04 Jan 2010 23:03:13 GMT]]></title><description><![CDATA[<p>Stichwort: QueryPerformanceCounter</p>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1832602</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1832602</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Mon, 04 Jan 2010 23:03:13 GMT</pubDate></item><item><title><![CDATA[Reply to Zeitmess problem on Tue, 05 Jan 2010 09:39:35 GMT]]></title><description><![CDATA[<p>SYSTEMTIME now;<br />
GetSystemTime(&amp;now);</p>
<p>now.wMilliseconds;</p>
<p>läuft toll</p>
<pre><code class="language-cli">/// ptimer.h
#include &lt;windows.h&gt;
#include &lt;time.h&gt;

// A Simple Timer
// No License 

// call myTimer.Start() to start
// call myTimer.Stop() to stop
// return value myTimer.eLAPSED
// dont forget to declare a timer struct ATIMER myTimer; 

SYSTEMTIME now;

typedef struct tagATimerP{
 void Start(void);
 bool started;
 int msecs;
 int secs;
 struct tagElapsed{
	 int Msecs;
	 int Secs;
 } eLAPSED;
 bool stoped;
 void Stop(void);
} ATIMER;

void ATIMER::Start(void){
GetSystemTime(&amp;now);
ATIMER::secs=now.wSecond;
ATIMER::msecs=now.wMilliseconds;
  ATIMER::stoped=false;
  ATIMER::started=true;
}

void ATIMER::Stop(void){
    GetSystemTime(&amp;now);
	ATIMER::stoped=true;
	ATIMER::started=false;
	ATIMER::eLAPSED.Secs=now.wSecond-ATIMER::secs;
	ATIMER::eLAPSED.Msecs=now.wMilliseconds-ATIMER::msecs;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1832749</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1832749</guid><dc:creator><![CDATA[punky]]></dc:creator><pubDate>Tue, 05 Jan 2010 09:39:35 GMT</pubDate></item><item><title><![CDATA[Reply to Zeitmess problem on Tue, 05 Jan 2010 09:45:46 GMT]]></title><description><![CDATA[<p>Ich würde im Fall eienr Zeitmessung auch auf QueryPerformanceCounter zurückgriefen. SYSTEMTIME kann hier uu unnötige Rechnerei erzeugen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1832759</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1832759</guid><dc:creator><![CDATA[Xebov@Logoff]]></dc:creator><pubDate>Tue, 05 Jan 2010 09:45:46 GMT</pubDate></item></channel></rss>