Skip to content

Instantly share code, notes, and snippets.

@jesuscampos
Last active October 12, 2018 20:16
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 jesuscampos/1007fb8aefd92fea4dff6a633f0007d3 to your computer and use it in GitHub Desktop.
Save jesuscampos/1007fb8aefd92fea4dff6a633f0007d3 to your computer and use it in GitHub Desktop.
Async await
public long DoWork(int n)
{
// CPU-Bound work
// ...
return fibonacciNumber;
}
private async void Button1_Click(object sender, EventArgs e)
{
await Task.Run(() => DoWork(100));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment