... The advice is fine, Richard just said I *must* have a timer loop and that s not true. ... Windows runs all those things [anti-virus scans, some chron tasksMessage 1 of 11 , May 20View SourceOn 5/20/2013 12:29 PM, Rod wrote:
> I'm not quite sure why you don't value the advice.The advice is fine, Richard just said I *must* have a timer loop and
that's not true.
> Both the timerWindows runs all those things [anti-virus scans, some chron tasks to
> statement and the Sleep statement cause the processor to pause and look
> elsewhere for tasks to do. That might be a background defragmentation or
> a virus check.
download and sort email, and the like] with my loop running now.
Windows decides when my program gets CPU cycles and when other tasks do.
Truthfully, I can't tell.
> It might work but that is not to say it is good practice or desirable. AI don't understand the concern for CPU cycles on a Win 7 machine, it's
> microprocessor environment is quite different and endless looping is
> pretty much the norm. But in a multi tasking Windows environment you
> should consider what processing cycles you are hogging.
going to be doing something, no matter what until it goes into standby
from inactivity. My laptop does that as do my Android devices, but this
desktop doesn't and the idle loop in Windows is shorter that the one I
built. It happens to be a dual-core but that's really irrelevant. I
*have* worked on systems where every cycle counted, the Apollo Guidance
Computer is one example, and we'd never have built a loop like this, but
this isn't one of those.
>It's been my experience that the number of latent defects in computer
> But hey it works for you and you are achieving stuff so that's all good.
code seems to be approximately proportional to the square of the number
of lines of code. Thus, over the years, I've learned to keep it as
simple as I can, and give control to something else [like a DLL into
which I have no visibility] only when it is really necessary.
The original question concerned how SCAN worked. In its simplest form,
it works like my loop uses it.