Last active
February 2, 2016 15:58
-
-
Save idkaaa/e6f224e29b9a78a3d43a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task DoWork() | |
{ | |
//blocking | |
//int res = await Task.FromResult<int>(GetSum(4, 5)); | |
//non-blocking | |
int res = await Task<int>.Run(() => GetSum(4, 5)); | |
} | |
private int GetSum(int a, int b) | |
{ | |
return a + b; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment