|
@@ -412,11 +412,7 @@ namespace System.Reactive.Concurrency
|
|
|
public IDisposable StartTimer(Action<object> action, object state, TimeSpan dueTime)
|
|
|
{
|
|
|
var cancel = new CancellationDisposable();
|
|
|
-#if USE_TASKEX
|
|
|
- TaskEx.Delay(dueTime, cancel.Token).ContinueWith(
|
|
|
-#else
|
|
|
- Task.Delay(dueTime, cancel.Token).ContinueWith(
|
|
|
-#endif
|
|
|
+ TaskHelpers.Delay(dueTime, cancel.Token).ContinueWith(
|
|
|
_ => action(state),
|
|
|
TaskContinuationOptions.ExecuteSynchronously | TaskContinuationOptions.OnlyOnRanToCompletion
|
|
|
);
|
|
@@ -436,11 +432,7 @@ namespace System.Reactive.Concurrency
|
|
|
var moveNext = default(Action);
|
|
|
moveNext = () =>
|
|
|
{
|
|
|
-#if USE_TASKEX
|
|
|
- TaskEx.Delay(period, cancel.Token).ContinueWith(
|
|
|
-#else
|
|
|
- Task.Delay(period, cancel.Token).ContinueWith(
|
|
|
-#endif
|
|
|
+ TaskHelpers.Delay(period, cancel.Token).ContinueWith(
|
|
|
_ =>
|
|
|
{
|
|
|
moveNext();
|
|
@@ -465,12 +457,7 @@ namespace System.Reactive.Concurrency
|
|
|
|
|
|
public void Sleep(TimeSpan timeout)
|
|
|
{
|
|
|
-#if USE_TASKEX
|
|
|
- TaskEx.Delay(timeout).Wait();
|
|
|
-#else
|
|
|
- Task.Delay(timeout).Wait();
|
|
|
-#endif
|
|
|
-
|
|
|
+ TaskHelpers.Delay(timeout).Wait();
|
|
|
}
|
|
|
|
|
|
public IStopwatch StartStopwatch()
|