G
Guest
I created system.timers.timer for very long interval from TimeSpan.MaxValue:
myTimer = new System.Timers.Timer(TimeSpan.MaxValue.TotalMilliseconds)
After calling Enable = true I have a ArgumentOutOfRangeException exception.
I found out that timer internally uses System.Threading.Timer object and uses
constructor with "int" for dueTime. I suppose it explicitly converts double
to int without checking for overflow and System.Threading.Timer is created
with negative number for dueTime which throws an exception.
Is it a bug ?
myTimer = new System.Timers.Timer(TimeSpan.MaxValue.TotalMilliseconds)
After calling Enable = true I have a ArgumentOutOfRangeException exception.
I found out that timer internally uses System.Threading.Timer object and uses
constructor with "int" for dueTime. I suppose it explicitly converts double
to int without checking for overflow and System.Threading.Timer is created
with negative number for dueTime which throws an exception.
Is it a bug ?