?
Solved

How to delay a process.

Posted on 2013-11-15
2
Medium Priority
?
351 Views
Last Modified: 2013-11-16
I am executing three processes:

       BuildSymbolWork1(strSourcePath + "AMEX.txt", conStockSelect,"AMEX");
       BuildSymbolWork1(strSourcePath + "NASDAQ.txt", conStockSelect,"NASDAQ");
       BuildSymbolWork1(strSourcePath + "NYSE.txt", conStockSelect,"NYSE");

 private void BuildSymbolWork1(string pstrSourceFile, SqlConnection pconStockSelect,string pstrMarketName)
        {
       
Do Stuff
}

The processes work, except that the processing never stops.

All is fine when I run in debug mode and set a break point before each BuildSymbolWork1()


The process continues forever when Start Without debugging.

How can I delay after each execution?

      BuildSymbolWork1(strSourcePath + "AMEX.txt", conStockSelect,"AMEX");

//Delay 5 seconds
       BuildSymbolWork1(strSourcePath + "NASDAQ.txt", conStockSelect,"NASDAQ");

//Delay 5 seconds

       BuildSymbolWork1(strSourcePath + "NYSE.txt", conStockSelect,"NYSE");

//Delay 5 seconds

Thanks
0
Comment
Question by:Dovberman
2 Comments
 
LVL 36

Accepted Solution

by:
Miguel Oz earned 2000 total points
ID: 39652835
You can use Sleep method, for example:
Thread.Sleep(5000);//Delay 5 seconds
0
 

Author Closing Comment

by:Dovberman
ID: 39653171
Just what I needed.

Thank you.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

830 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