• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 171
  • Last Modified:

Pauses

I am using Microsoft Visual C++ and I was wondering if it is possible to make the program pause for a certain amount of seconds and then start up again.  I want the user of my program to be able to read a sentence and then for the program to continue running after they have enough time to read it, which would be from 5-7 seconds.

Is this possible or do I have to live with what I have of having everything on the screen at once?

Mark
0
simpsons17371
Asked:
simpsons17371
1 Solution
 
e12voltsdacCommented:
you can use the sleep function:

Sleep(milliseconds);

found in stdlib.h

or make a loop:

for(int i=0;i<1000000;++i)
{}
0
 
unknownmatCommented:
I'm not certain what your application is, but if you are just using the console window you could use _getch() in <conio.h>.  This will pause things until the user presses a key.

Also, there is the win32 API function Sleep(milliseconds) in <windows.h> ...

Like I said, I'm not sure what you are working on, both are, imo, cheap 'n dirty.  But to just pause things temporarily (for debuggin, say) you can't beat them.

Matt



0
 
simpsons17371Author Commented:
thanks guys

Mark
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now