Skip to content

Instantly share code, notes, and snippets.

@einarwh
Created July 4, 2014 21:41
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 einarwh/761e7af0c10524e0bb40 to your computer and use it in GitHub Desktop.
Save einarwh/761e7af0c10524e0bb40 to your computer and use it in GitHub Desktop.
Func<string> q = () => {
Thread.Sleep(2000);
return "Hard-obtained string";
};
Console.WriteLine(q());
Console.WriteLine(q());
Console.WriteLine(q());
q = q.Caching();
Console.WriteLine(q());
Console.WriteLine(q());
Console.WriteLine(q());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment