diff --git a/FluentScheduler/Scheduler/InternalSchedule.cs b/FluentScheduler/Scheduler/InternalSchedule.cs index 4921f932..7bf15a0a 100644 --- a/FluentScheduler/Scheduler/InternalSchedule.cs +++ b/FluentScheduler/Scheduler/InternalSchedule.cs @@ -116,6 +116,10 @@ private async Task Run(CancellationToken token) // used on both JobStarted and JobEnded events var startTime = Calculator.Now(); + // start time can be before NextRun, because of the nature of CPUs + // to ensure, that this does not run code twice, we can set the startTime to the "perfect" NextRun value + if (startTime < NextRun) + startTime = NextRun.Value; // calculating the next run // used on both JobEnded event and for the next run of this method