Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to stop program execution

Status
Not open for further replies.

JackMorris

Technical User
Jan 30, 2003
18
IE
A project which I am doing takes 6 mins as an execution time.

If I want the program execution to stop at 3 mins how can i do that?

 
If You starts slow operation in a new thread, You can anytime interrupt it. To do it after 3 mins, use Timer (SetTimer() etc.). If You starts the slow operation not in a new thread, Timer's messages will probably not be processed by application - then You can program system timer (int0) with a driver to check time.
 
You could use SetTimer. At the start of your program execute a SetTimer command with a time of 180*1000 (i.e. 180,000 milliseconds). 3 minutes later a TIMER event will be triggered and you trap this and kill your program.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top