DD.WellWorkover.Cloud/ConsoleApp1/Cron.cs
2022-05-31 16:38:04 +05:00

18 lines
368 B
C#

using System;
namespace ConsoleApp1
{
class Cron
{
public DateTimeOffset Origin { get; set; }
public TimeSpan Period { get; set; }
public DateTimeOffset Next()
{
var delta = DateTimeOffset.Now - Origin;
var n = Math.Ceiling(delta / Period);
return Origin + n * Period;
}
}
}