Stop Making that noice!
Ive got a program, which uses:
while(bRunning)
{
}
But I don''t want this program to take that much processor speed. So how can I add a time out or something? That it wont take that much processor speed?
depends on what exactly code inside the loop does.
you''ll have to use one of the functions that pause thread execution until a certain event occurs, such as:
sleep
getmessage
waitforsingleobject
which to use, as i said, depends on your code.
you''ll have to use one of the functions that pause thread execution until a certain event occurs, such as:
sleep
getmessage
waitforsingleobject
which to use, as i said, depends on your code.
Well, my code doesn''t have alot more than what ive said:
while(bRunning)
{
}
It''s not a thread. It uses one thread, but that''s just one thread with a messagebox, and then it stops.
I guess sleep is the best one for me but... Which file do I have to include?
while(bRunning)
{
}
It''s not a thread. It uses one thread, but that''s just one thread with a messagebox, and then it stops.
I guess sleep is the best one for me but... Which file do I have to include?
look it up on msdn.
if you''re using a thread and want to wait until something happens, use the event object (createevent) and waitforsingleobject.
if you''re using a thread and want to wait until something happens, use the event object (createevent) and waitforsingleobject.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement