Solved

How to delay a process.

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

706 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

13 Experts available now in Live!

Get 1:1 Help Now