<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>VoiceBot RSS: CPU friendly infinite loop</title>
<atom:link href="https://www.voicebot.net/Discussions/RSS/?TopicID=068a8f8b-0b73-48e6-bd85-92cec9bee096" rel="self" type="application/rss+xml" />
<link>https://www.voicebot.net/Discussions/RSS/?TopicID=068a8f8b-0b73-48e6-bd85-92cec9bee096</link>
<description>VoiceBot RSS: CPU friendly infinite loop</description>
<lastBuildDate>Mon, 20 Jul 2026 12:03:12 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.voicebot.net/Discussions/RSS/?TopicID=068a8f8b-0b73-48e6-bd85-92cec9bee096</generator>
<item>
<title>RE: CPU friendly infinite loop</title>
<link>https://www.voicebot.net/Discussions/View/cpu-friendly-infinite-loop/?ID=068a8f8b-0b73-48e6-bd85-92cec9bee096#4</link>
<pubDate>Tue, 04 Dec 2018 15:53:01 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.voicebot.net/Discussions/View/cpu-friendly-infinite-loop/?ID=068a8f8b-0b73-48e6-bd85-92cec9bee096#4</guid>
<category>VoiceBot</category>
<description><![CDATA[Ok, sounds good!]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Ok, sounds good!
</div>
]]></content:encoded>
</item>
<item>
<title>RE: CPU friendly infinite loop</title>
<link>https://www.voicebot.net/Discussions/View/cpu-friendly-infinite-loop/?ID=068a8f8b-0b73-48e6-bd85-92cec9bee096#3</link>
<pubDate>Tue, 04 Dec 2018 05:15:27 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.voicebot.net/Discussions/View/cpu-friendly-infinite-loop/?ID=068a8f8b-0b73-48e6-bd85-92cec9bee096#3</guid>
<category>VoiceBot</category>
<description><![CDATA[Thank you Keith
Did try threadwait but that seemed to slow the entire script and the watchers did not work.
the cpu usage has improved greatly using delay dropping form 13 percent to less then 3 so happy with the improvement]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Thank you Keith <br/>
<br/>
Did try threadwait but that seemed to slow the entire script and the watchers did not work. <br/>
<br/>
the cpu usage has improved greatly using delay dropping form 13 percent to less then 3 so happy with the improvement
</div>
]]></content:encoded>
</item>
<item>
<title>RE: CPU friendly infinite loop</title>
<link>https://www.voicebot.net/Discussions/View/cpu-friendly-infinite-loop/?ID=068a8f8b-0b73-48e6-bd85-92cec9bee096#2</link>
<pubDate>Tue, 04 Dec 2018 01:43:43 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.voicebot.net/Discussions/View/cpu-friendly-infinite-loop/?ID=068a8f8b-0b73-48e6-bd85-92cec9bee096#2</guid>
<category>VoiceBot</category>
<description><![CDATA[The only way really would be to use thread sleeps, like you did. If you try BFS.General.ThreadWait(1) instead, does that work better?]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
The only way really would be to use thread sleeps, like you did. If you try BFS.General.ThreadWait(1) instead, does that work better?
</div>
]]></content:encoded>
</item>
<item>
<title>CPU friendly infinite loop</title>
<link>https://www.voicebot.net/Discussions/View/cpu-friendly-infinite-loop/?ID=068a8f8b-0b73-48e6-bd85-92cec9bee096</link>
<pubDate>Fri, 30 Nov 2018 21:03:58 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.voicebot.net/Discussions/View/cpu-friendly-infinite-loop/?ID=068a8f8b-0b73-48e6-bd85-92cec9bee096</guid>
<category>VoiceBot</category>
<description><![CDATA[I am currently using a  while(true) {       }  too keep my elite journal reader program active but would like to make it less cpu intensive. any help or ideas would be greatly appreciated.
A Small delay of 1ms does improve CPU usage dramatically but some events are missed during the wait time.
...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
I am currently using a  while(true) {       }  too keep my elite journal reader program active but would like to make it less cpu intensive. any help or ideas would be greatly appreciated.<br/>
<br/>
A Small delay of 1ms does improve CPU usage dramatically but some events are missed during the wait time. <br/>
<br/>
 <div class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code019f7f68a72c709785b0dfeb4fa0a838" class="ClipboardCopyControl"><img src="https://www.voicebot.net/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019f7f68a72c709785b0dfeb4fa0a838Js'); return false;"><img src="https://www.voicebot.net/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code019f7f68a72c709785b0dfeb4fa0a838Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">public static void ReadLog()
        {
        // creat event watcher    
     
            FileSystemWatcher watcher = new FileSystemWatcher();
            watcher.Path = logpath;
            watcher.NotifyFilter = NotifyFilters.LastWrite; 
           NotifyFilters.FileName;         
            // Add event handlers.
            watcher.Changed += new FileSystemEventHandler(OnChanged);
       
            // Begin watching.
            watcher.EnableRaisingEvents = true;
         
            //infinite loop
            while(true)
            {
               BFS.VoiceBotActions.Delay(1);
            }
        }</pre><textarea id="code019f7f68a72c709785b0dfeb4fa0a838" name="code019f7f68a72c709785b0dfeb4fa0a838" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
</channel>
</rss>