i need a little help with a timer funtion.
I have await Times in Minutes (3m, 5m, 15m, 30m, 60m, 120m........ 1440m and so on) that must fire on the exact time a function and must ignore the starttime...
Also like so:
Starttime: 00:51 > 3m > Starts at 00:54
Starttime: 00:51 > 5m > Starts at 00:55
Starttime: 00:51 > 30m > Starts at 01:00
Starttime: 09:51 > 120m > Starts at 10:00
Starttime: 11:51 > 240m > Starts at 12:00
Starttime: 11:51 > 480m > Starts at 16:00
Starttime: 21:51 > 1440m > Starts next Day at 00:00
... and so on
i have this code:
int Minutes = value;
TimeSpan calc = TimeSpan.FromMinutes(Minutes - DateTime.Now.Minute % Minutes);
double calc1 = calc.TotalMinutes * 60 * 1000;
return Convert.ToInt32(calc1);
....
await Task.Delay(returnvalue);
Seems not working with Minutes Values greater then 60 Minutes, why? anyone know a better working solution? thx <33