Created
October 6, 2015 21:16
-
-
Save i3arnon/d2d81cba5ae3c7425d29 to your computer and use it in GitHub Desktop.
Task.Run over Task.Factory.StartNew
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
Task task = Task.Run(async () => | |
{ | |
while (IsEnabled) | |
{ | |
await FooAsync(); | |
await Task.Delay(TimeSpan.FromSeconds(10)); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment