Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void RunForever(Action method, TimeSpan timeSpan)
- {
- _runnerTask = Task.Delay(timeSpan, _cancellationTokenSource.Token).ContinueWith((a)=>
- {
- method();
- if (a.IsCanceled)
- {
- return;
- }
- RunForever(method, timeSpan);
- });
- }
- }
Add Comment
Please, Sign In to add comment