System.Timers.Timer.Timer C# (CSharp) Méthode

Timer() public méthode

Initializes a new instance of the class, setting the property to the specified period.

public Timer ( double interval ) : System.Threading
interval double
Résultat System.Threading
        public Timer(double interval)
        : this()
        {
            if (interval <= 0)
                throw new ArgumentException(SR.Format(SR.InvalidParameter, nameof(interval), interval));

            double roundedInterval = Math.Ceiling(interval);
            if (roundedInterval > int.MaxValue || roundedInterval <= 0)
            {
                throw new ArgumentException(SR.Format(SR.InvalidParameter, nameof(interval), interval));
            }

            _interval = (int)roundedInterval;
        }

Same methods

Timer::Timer ( ) : System.Threading