Click here to Skip to main content
15,913,944 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: vc60.pdb Pin
Gary R. Wheeler5-Dec-04 10:06
Gary R. Wheeler5-Dec-04 10:06 
Generalinterchanging between two dialog boxes Pin
haseeb_saeed4-Dec-04 10:34
haseeb_saeed4-Dec-04 10:34 
GeneralRe: interchanging between two dialog boxes Pin
John R. Shaw4-Dec-04 11:35
John R. Shaw4-Dec-04 11:35 
Questionhow to control program execution speed Pin
Mohammad A Gdeisat4-Dec-04 9:16
Mohammad A Gdeisat4-Dec-04 9:16 
AnswerRe: how to control program execution speed Pin
Stanciu Vlad4-Dec-04 9:37
Stanciu Vlad4-Dec-04 9:37 
AnswerRe: how to control program execution speed Pin
John R. Shaw4-Dec-04 10:34
John R. Shaw4-Dec-04 10:34 
GeneralRe: how to control program execution speed Pin
Mohammad A Gdeisat5-Dec-04 5:43
Mohammad A Gdeisat5-Dec-04 5:43 
GeneralRe: how to control program execution speed Pin
David Crow6-Dec-04 3:08
David Crow6-Dec-04 3:08 
Mohammad A Gdeisat wrote:
But the problem is Sleep has a waiting loop, this loop captures some of CPU time, although i am not a professional programmer, i feel that there must be a way to use the cpu more efficiently.

Don't you have something similar to:

while (more_pics == TRUE)
{
    DisplayPic();
    Sleep(1000); // 1 second
}
This should render a new picture every second regardless of the CPU speed.

I don't know how you've determined that Sleep() uses any CPU time because it does not. You can easily verify this by running the following code and using Task Manager to watch the CPU usage of the running processes.

void main( void )
{
    for (int x = 0; x < 10; x++)
        Sleep(2000);
}
Looking at the Performance tab, the CPU usage should stay in the 3-4% range.


"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow


GeneralRe: how to control program execution speed Pin
Mohammad A Gdeisat6-Dec-04 9:31
Mohammad A Gdeisat6-Dec-04 9:31 
GeneralRe: how to control program execution speed Pin
David Crow6-Dec-04 9:39
David Crow6-Dec-04 9:39 
GeneralRegistering file type and icon Pin
SloanCode4-Dec-04 7:40
SloanCode4-Dec-04 7:40 
GeneralRe: Registering file type and icon Pin
Michael Dunn4-Dec-04 9:01
sitebuilderMichael Dunn4-Dec-04 9:01 
GeneralUser Interface - Advice Required Pin
Imtiaz Murtaza4-Dec-04 7:27
Imtiaz Murtaza4-Dec-04 7:27 
GeneralRe: User Interface - Advice Required Pin
Maximilien4-Dec-04 8:49
Maximilien4-Dec-04 8:49 
GeneralRe: User Interface - Advice Required Pin
toddbrooks4-Dec-04 9:37
toddbrooks4-Dec-04 9:37 
GeneralRe: User Interface - Advice Required Pin
peterchen5-Dec-04 0:36
peterchen5-Dec-04 0:36 
GeneralRe: User Interface - Advice Required Pin
Tareq Ahmed Siraj5-Dec-04 5:26
Tareq Ahmed Siraj5-Dec-04 5:26 
GeneralRe: User Interface - Advice Required Pin
Henry miller6-Dec-04 6:50
Henry miller6-Dec-04 6:50 
GeneralOninitUpdate Pin
jimjake4-Dec-04 4:01
jimjake4-Dec-04 4:01 
GeneralRe: OninitUpdate Pin
Ravi Bhavnani4-Dec-04 6:00
professionalRavi Bhavnani4-Dec-04 6:00 
QuestionHow to force the control to redraw? Pin
ytod4-Dec-04 3:44
ytod4-Dec-04 3:44 
AnswerRe: How to force the control to redraw? Pin
User 66584-Dec-04 4:22
User 66584-Dec-04 4:22 
AnswerRe: How to force the control to redraw? Pin
John R. Shaw4-Dec-04 10:54
John R. Shaw4-Dec-04 10:54 
GeneralFile stream as function parameter Pin
vilmer3-Dec-04 22:16
vilmer3-Dec-04 22:16 
GeneralRe: File stream as function parameter Pin
toxcct3-Dec-04 22:21
toxcct3-Dec-04 22:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.