Skip to content

Instantly share code, notes, and snippets.

@wujiwh
Created January 19, 2012 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wujiwh/1638839 to your computer and use it in GitHub Desktop.
Save wujiwh/1638839 to your computer and use it in GitHub Desktop.
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