/ Published in: C#
Saw some strange console app behavior while hosting quartz.net had to doublecheck that a console app will not exit while background threads are running. In the example below, once the main method ends, the app stays alive for 10 seconds while the background thread finishes.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
static void Main(string[] args) { t.Start(); Console.ReadKey(); } static void SleepyTime() { Thread.Sleep(10000); }
URL: http://www.albahari.com/threading/