using System;
using System.Threading;
using System.Threading.Tasks;

namespace StellaOps.Scanner.Worker.Processing;

public sealed class SystemDelayScheduler : IDelayScheduler
{
    public Task DelayAsync(TimeSpan delay, CancellationToken cancellationToken)
    {
        if (delay <= TimeSpan.Zero)
        {
            return Task.CompletedTask;
        }

        return Task.Delay(delay, cancellationToken);
    }
}
