mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
34 lines
719 B
C#
34 lines
719 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BTCPayServer
|
|
{
|
|
public interface IDelay
|
|
{
|
|
Task Wait(TimeSpan delay, CancellationToken cancellationToken);
|
|
}
|
|
|
|
public class TaskDelay : IDelay
|
|
{
|
|
TaskDelay()
|
|
{
|
|
|
|
}
|
|
private static readonly TaskDelay _Instance = new TaskDelay();
|
|
public static TaskDelay Instance
|
|
{
|
|
get
|
|
{
|
|
return _Instance;
|
|
}
|
|
}
|
|
public Task Wait(TimeSpan delay, CancellationToken cancellationToken)
|
|
{
|
|
return Task.Delay(delay, cancellationToken);
|
|
}
|
|
}
|
|
}
|