PeekMessage( <msec> )

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post by Rescator »

Trond wrote:40%+60% is 100%, right? The total CPU use will be 100% with Delay(0).
Of course. If the program needs all the CPU available but without hogging the CPU then Delay(0) is a nice choice.

If you are so concerned about CPU use just lower the priority of the process in taskmanager, or make te programs use background timeslices (theres a Win API for that if I recall?).

Don't tell me you complain about say CS or Crysis etc. using all free CPU as well?

If the programmer is good and the program is flexible enough to be able to do it, then there should be a program option allowing adjustment of system load. (aka. a foreground and a background mode, various archiver tools and encoders tend to have those options.)

So you don't want any programs to use all free CPU, which means you don't mind that something takes 4 hours to complete vs 10 minutes.
Which do you think is more friendly to the machine? 4 hours of average work or 10 min of intense but short work?

If you hate the fan so much get rid of it :P

As to battery, I certainly would never run any heaving processing with battery alone, I'd stick in the wall plug for that. ;)

If the programmer is good and the program is flexible enough to be able to do it, then there should be a program option allowing adjustment of system load. (aka. a foreground and a background mode, various archiver tools and encoders tend to have those options.)

I doubt photoshop or similar is very CPU friendly for example? :)

Every program should only use as much CPU as it needs, but how do you programtically know that? You can't! (at least easily)
And also, some programs need all the CPU they can get.

I assume when you talk about the fan kicking in it's a knee jerk reaction to badly made program loops (as I've mentioned a few times before on the forums) and I agree fully with you on that.

But Delay(0) is not bad if used appropriately, it is certainly better than none at all (watch Windows become sirup :)
.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

So you don't want any programs to use all free CPU
They shouldn't all free CPU just to run an empty loop.
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post by Rescator »

Ofcourse not, I'm talking about bigger processing loops.
In a recent post (forgot whom/which) I posted a edit of their source where if the user does nothing then the loop uses 0% cpu, and when the user does move the mouse it uses more or less what it needs when it needs it. :)
Post Reply