Solved

How to delay a process.

Posted on 2013-11-15
2
347 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
[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
2 Comments
 
LVL 36

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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
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…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

742 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