Create a new Thread Delegate using C#


Below is a code that demonstrates how to create a Thread Delegate, which calls a function that will do some work for you in the background.

        static void Main(string[] args)
        {
            // Creating a thread Delegate
            System.Threading.Thread _thread = new System.Threading.Thread(new System.Threading.ThreadStart(FuctionDoBackgroundWork));
            _thread.Start();

        }
        // Fucntion that the thread delegate Starts
        public static void FuctionDoBackgroundWork()
        {
            // Background work goes here
        }

More C# Snippets

Asha Shoukeir

About Asha shoukeir

Software Developer and System Administrator

View all posts by Asha shoukeir →