<?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[Hilfe für Timer]]></title><description><![CDATA[<p>Hallo,</p>
<p>habe bereits im C/C++ Forum :: VCL/CLX (Borland C++ Builder) diese Frage gestellt, und wurde hier verwiesen.</p>
<p>Suche eine Komponente / Routine , die einen Timer mit 1 ms darstellt, welche wiederholt gestartet wird.</p>
<p>vielen Dank im voraus.</p>
<p>Gruß Siegfried</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/130880/hilfe-für-timer</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 22:46:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/130880.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 28 Dec 2005 13:31:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hilfe für Timer on Wed, 28 Dec 2005 13:31:00 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>habe bereits im C/C++ Forum :: VCL/CLX (Borland C++ Builder) diese Frage gestellt, und wurde hier verwiesen.</p>
<p>Suche eine Komponente / Routine , die einen Timer mit 1 ms darstellt, welche wiederholt gestartet wird.</p>
<p>vielen Dank im voraus.</p>
<p>Gruß Siegfried</p>
]]></description><link>https://www.c-plusplus.net/forum/post/951457</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/951457</guid><dc:creator><![CDATA[Beppo]]></dc:creator><pubDate>Wed, 28 Dec 2005 13:31:00 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe für Timer on Wed, 28 Dec 2005 13:34:32 GMT]]></title><description><![CDATA[<p>Vorbemerkung: <strong>Windows ist kein Echtzeit Betriebssystem</strong>!<br />
Du kannst die Multimedia-Timer versuchen...<br />
<a href="http://msdn.microsoft.com/library/en-us/multimed/htm/_win32_multimedia_timers.asp" rel="nofollow">http://msdn.microsoft.com/library/en-us/multimed/htm/_win32_multimedia_timers.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/951462</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/951462</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Wed, 28 Dec 2005 13:34:32 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe für Timer on Wed, 28 Dec 2005 14:25:32 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">class SekundenZaehler
{
    private:
        __int64 Frequency;
        __int64 StartCount;
        __int64 PerformanceCount;
    public:
        SekundenZaehler()
        {
            QueryPerformanceFrequency((LARGE_INTEGER*)&amp;Frequency);
            Reset();
        }
        void Reset()
        {
            QueryPerformanceCounter((LARGE_INTEGER*)&amp;StartCount);
        }
        float Get()
        {
            QueryPerformanceCounter((LARGE_INTEGER*)&amp;PerformanceCount);
            return (PerformanceCount - StartCount) / (float)Frequency;
        }
};
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/951481</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/951481</guid><dc:creator><![CDATA[joomoo]]></dc:creator><pubDate>Wed, 28 Dec 2005 14:25:32 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe für Timer on Thu, 29 Dec 2005 10:16:25 GMT]]></title><description><![CDATA[<p>Wenn du mit VC++ 6.0 arbeitest könntest du dies mit der OnTimer Funktion lösen (so mach ich das halt immer) und dann einen timer mit SetTimer(int id, int 1 /*zeit = 1ms */, null) erstellen.<br />
Die OnTimer Funktion kannst du wenn du STRG + W drückst einfach hinzufügen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/951954</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/951954</guid><dc:creator><![CDATA[Frittnschneider]]></dc:creator><pubDate>Thu, 29 Dec 2005 10:16:25 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe für Timer on Thu, 29 Dec 2005 11:49:43 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>muß noch alle Infos verarbeiten. Weiß noch nicht, wie ich dies umsetze. Verstehe trotzdem nicht, weshalb ich keinen Interval von 1 ms bei einem Timer hinbekomme.</p>
<p>Gruß Siegfried</p>
]]></description><link>https://www.c-plusplus.net/forum/post/952031</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/952031</guid><dc:creator><![CDATA[Beppo]]></dc:creator><pubDate>Thu, 29 Dec 2005 11:49:43 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe für Timer on Thu, 29 Dec 2005 11:56:19 GMT]]></title><description><![CDATA[<p>Beppo schrieb:</p>
<blockquote>
<p>Verstehe trotzdem nicht, weshalb ich keinen Interval von 1 ms bei einem Timer hinbekomme.</p>
</blockquote>
<p>Mit SetTime bekommst Du es nicht hin, weil Windows kein Echtzeitbetriebssystem ist und es deshalb eine Auflösung von 10-20 ms hat.<br />
Du kannst Dir wie gesagt höchstens die Multimedia-Timer anschauen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/952033</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/952033</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Thu, 29 Dec 2005 11:56:19 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe für Timer on Thu, 29 Dec 2005 17:29:19 GMT]]></title><description><![CDATA[<p>Beppo schrieb:</p>
<blockquote>
<p>Hallo,</p>
<p>muß noch alle Infos verarbeiten. Weiß noch nicht, wie ich dies umsetze. Verstehe trotzdem nicht, weshalb ich keinen Interval von 1 ms bei einem Timer hinbekomme.</p>
<p>Gruß Siegfried</p>
</blockquote>
<p>Du initialisiert die Klasse dich ich gepostet habe und die get funktion sagt dir dann wieviel sekunden seit der initialisierung vergangen sind. mit reset() kannst du die zeit wieder auf 0 s setzen.</p>
<p>Wofür brauchst du es eigentlich`??</p>
<p>mfg.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/952294</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/952294</guid><dc:creator><![CDATA[joomoo]]></dc:creator><pubDate>Thu, 29 Dec 2005 17:29:19 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe für Timer on Thu, 29 Dec 2005 18:53:53 GMT]]></title><description><![CDATA[<p>Hallo joomoo,</p>
<p>in einer Schleife möchte ich eine IO-Karte abfragen. Dazu habe ich die Komponente &quot;Timer&quot; von C++ eingesetzt. Leider mußte ich feststellen, das kleinere Zeitwerte von 20 ms ignoriert werden. Somit hätte ich ein Zyklus von ca 50-60 pro Sekunde. Dies ist mir zu wenig. Die Klasse die du gepostet hast kenne ich, zwar in einer anderen Art. Korrigiere mich bitte, wenn ich falsch denke. Die Klasse ist doch nur für eine Zeit Differenz Messung zwischen Start und End? Deshalb ist für mich unklar, wie ich diese einsetzen kann, für den Aufruf der Abfrage für die IO-Karte in meiner Routine, und dann nach Ablauf der Zeit X erneut meine Abfrage starte.</p>
<p>Gruß Siegfried</p>
]]></description><link>https://www.c-plusplus.net/forum/post/952367</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/952367</guid><dc:creator><![CDATA[Beppo]]></dc:creator><pubDate>Thu, 29 Dec 2005 18:53:53 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe für Timer on Thu, 29 Dec 2005 19:03:41 GMT]]></title><description><![CDATA[<p>Beppo schrieb:</p>
<blockquote>
<p>Hallo joomoo,</p>
<p>in einer Schleife möchte ich eine IO-Karte abfragen. Dazu habe ich die Komponente &quot;Timer&quot; von C++ eingesetzt. Leider mußte ich feststellen, das kleinere Zeitwerte von 20 ms ignoriert werden. Somit hätte ich ein Zyklus von ca 50-60 pro Sekunde. Dies ist mir zu wenig. Die Klasse die du gepostet hast kenne ich, zwar in einer anderen Art. Korrigiere mich bitte, wenn ich falsch denke. Die Klasse ist doch nur für eine Zeit Differenz Messung zwischen Start und End? Deshalb ist für mich unklar, wie ich diese einsetzen kann, für den Aufruf der Abfrage für die IO-Karte in meiner Routine, und dann nach Ablauf der Zeit X erneut meine Abfrage starte.</p>
<p>Gruß Siegfried</p>
</blockquote>
<p>Ich hatte mir das so vorgestellt: (pseudo code)</p>
<pre><code class="language-cpp">SekundenZaehler sz;
float sz_temp;
while(!done)
{
while(sz_temp &lt; sz.Get())
{
sz_temp += 0.001f; // für eine ms
Bla();
}
}
</code></pre>
<p>Die Bla() Funktion würde dann jede ms aufgerufen.</p>
<p>mfg.<br />
[/cpp]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/952371</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/952371</guid><dc:creator><![CDATA[joomoo]]></dc:creator><pubDate>Thu, 29 Dec 2005 19:03:41 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe für Timer on Thu, 29 Dec 2005 19:22:56 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Werde dies ausprobieren, Danke.</p>
<p>Gruß Siegfried</p>
]]></description><link>https://www.c-plusplus.net/forum/post/952384</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/952384</guid><dc:creator><![CDATA[Beppo]]></dc:creator><pubDate>Thu, 29 Dec 2005 19:22:56 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe für Timer on Thu, 29 Dec 2005 19:25:02 GMT]]></title><description><![CDATA[<p>joomoo schrieb:</p>
<blockquote>
<p>Die Bla() Funktion würde dann jede ms aufgerufen.</p>
</blockquote>
<p>Das ist aber nur Theorie...<br />
Ich muss es nochmals sagen: <strong>Windows ist kein Echtzeitbetriebssystem</strong>!</p>
<p>Nehmen wir mal an Du machst noch was anderes auf diesem Rechner. Zum Beispiel nur ein Thread der auch was für einige Sekunden tun will. Jetzt nehmen wir noch an, die Threads hätten noch die gleiche Priorität. Und schon hast Du den Salat. Dein &quot;I/O-Thread&quot; kommt jetzt nur alle 45 ms dran.<br />
Wenn Du es ganz genau wissen willst, warum das so ist, dann Beschäftige DIch mal mit OS Architektur / Quantums und Scheduling.<br />
Ich empfehle Dir dazu ganz dringend: Microsoft Windows Internals, 4th Edition<br />
<a href="http://www.microsoft.com/MSPress/books/6710.asp" rel="nofollow">http://www.microsoft.com/MSPress/books/6710.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/952385</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/952385</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Thu, 29 Dec 2005 19:25:02 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe für Timer on Thu, 29 Dec 2005 19:31:35 GMT]]></title><description><![CDATA[<p>Jochen Kalmbach schrieb:</p>
<blockquote>
<p>joomoo schrieb:</p>
<blockquote>
<p>Die Bla() Funktion würde dann jede ms aufgerufen.</p>
</blockquote>
<p>Das ist aber nur Theorie...<br />
Ich muss es nochmals sagen: <strong>Windows ist kein Echtzeitbetriebssystem</strong>!</p>
<p>Nehmen wir mal an Du machst noch was anderes auf diesem Rechner. Zum Beispiel nur ein Thread der auch was für einige Sekunden tun will. Jetzt nehmen wir noch an, die Threads hätten noch die gleiche Priorität. Und schon hast Du den Salat. Dein &quot;I/O-Thread&quot; kommt jetzt nur alle 45 ms dran.<br />
Wenn Du es ganz genau wissen willst, warum das so ist, dann Beschäftige DIch mal mit OS Architektur / Quantums und Scheduling.<br />
Ich empfehle Dir dazu ganz dringend: Microsoft Windows Internals, 4th Edition<br />
<a href="http://www.microsoft.com/MSPress/books/6710.asp" rel="nofollow">http://www.microsoft.com/MSPress/books/6710.asp</a></p>
</blockquote>
<p>Ja weiß ich doch, deswegen wollte ich ja auch wissen wofür er das braucht.<br />
Bei einem kleinem Spiel z.B. ist sowas nicht so wichtig.</p>
<p>mfg.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/952387</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/952387</guid><dc:creator><![CDATA[joomoo]]></dc:creator><pubDate>Thu, 29 Dec 2005 19:31:35 GMT</pubDate></item></channel></rss>