Skip to content

Instantly share code, notes, and snippets.

@wujiwh wujiwh/sageTest.cs
Created Jan 19, 2012

Embed
What would you like to do?
sageTest
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
namespace @delegate
{
static class Program
{
public delegate int TakesAWhileDelegate(int data, int ms);
static int TakesAWhile(int data, int ms)
{
Console.WriteLine("Takes a while start");
Thread.Sleep(ms);
Console.WriteLine("\nTakes a while completed");
return ++data;
}
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
{
new Thread(TakesAWhileDelegate(10, 1000) =>
{
}).Start();
Console.WriteLine("Hello World");
Console.Read();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.