FluentScheduler icon indicating copy to clipboard operation
FluentScheduler copied to clipboard

accumulated time

Open hackeroy opened this issue 6 years ago • 2 comments

This is my log for:

var ejecucion = DateTime.Now.AddMinutes(1); var registro = new Registry(); registro.Schedule(() => { var lineas = new string[] { DateTime.Now.ToString("dd/MM/yyyy - HH:mm:ss:fff") };
File.AppendAllLines(@"\logs\log.txt", lineas); }) .ToRunOnceAt(ejecucion.Hour, ejecucion.Minute) .AndEvery(1).Minutes();

24/10/2019 - 12:30:00:121 24/10/2019 - 12:31:00:123 24/10/2019 - 12:32:00:126 24/10/2019 - 12:33:00:128 24/10/2019 - 12:34:00:130 24/10/2019 - 12:35:00:148 24/10/2019 - 12:36:00:150 24/10/2019 - 12:37:00:152 24/10/2019 - 12:38:00:154 24/10/2019 - 12:39:00:156 24/10/2019 - 12:40:00:158 24/10/2019 - 12:41:00:170 24/10/2019 - 12:42:00:180 24/10/2019 - 12:43:00:182 24/10/2019 - 12:44:00:184 24/10/2019 - 12:45:00:186 24/10/2019 - 12:46:00:188 24/10/2019 - 12:47:00:190 24/10/2019 - 12:48:00:192 24/10/2019 - 12:49:00:207 24/10/2019 - 12:50:00:209 24/10/2019 - 12:51:00:211 24/10/2019 - 12:52:00:213 24/10/2019 - 12:53:00:217 24/10/2019 - 12:54:00:229 24/10/2019 - 12:55:00:231 24/10/2019 - 12:56:00:233 24/10/2019 - 12:57:00:235 24/10/2019 - 12:58:00:245 24/10/2019 - 12:59:00:247 24/10/2019 - 13:00:00:267 24/10/2019 - 13:01:00:269 24/10/2019 - 13:02:00:271 24/10/2019 - 13:03:00:289 24/10/2019 - 13:04:00:291

There are some time acomulated, in the future they will be hh:mm:00:999 and the next time hh:mm+1:01:012 (12 for example but can be arbitrary seconds)

It apear to add 1 minute and 1 second not only 1 minute that AndEvery(1).Minutes(); says. There are something that I cand configure for fix that issue?

hackeroy avatar Oct 24 '19 18:10 hackeroy

See #206. Basically what you want can be done once cron expressions are out in the rewritten version.

MarkusKgit avatar Oct 25 '19 05:10 MarkusKgit

It apear to add 1 minute and 1 second not only 1 minute that AndEvery(1).Minutes(); says. There are something that I cand configure for fix that issue?

It's actually adding a few milliseconds between each call, not an entire second. It ran for 34 calls spread over 34 minutes, there's 170ms added to the overall interval in your output.

This is natural due the time the library spends with 'itself' between each call, but sure still a problem to be addressed.

The problem persists in the redesign branch using fluent schedules, I got 89ms added for the same 34 minutes. As @MarkusKgit said, I didn't experience such accumulation with cron schedules (though they're not available in the current version).

tallesl avatar Apr 03 '20 03:04 tallesl