?
Solved

Pauses

Posted on 2003-03-20
3
Medium Priority
?
170 Views
Last Modified: 2010-04-01
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
Comment
Question by:simpsons17371
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Accepted Solution

by:
e12voltsdac earned 100 total points
ID: 8178964
you can use the sleep function:

Sleep(milliseconds);

found in stdlib.h

or make a loop:

for(int i=0;i<1000000;++i)
{}
0
 

Expert Comment

by:unknownmat
ID: 8178985
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
 
LVL 1

Author Comment

by:simpsons17371
ID: 8179000
thanks guys

Mark
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question