Solved

How to delay a process.

Posted on 2013-11-15
2
344 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 35

Accepted Solution

by:
Miguel Oz earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

910 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now