What happens if the tick timer calculation takes longer than the Tick length?

In C # System.Windows.Forms.Timer, what happens if the code in the timer tick takes longer than the tick length?

For example, in the code below, what happens if the tag update takes longer than the tick interval (1 second)?

private void timerProgress_Tick( object sender, EventArgs e )
    {
        if( label.Value <= label.Maximum )
        {
            label.Value = item;
        }
        update_label();
    }

I can't seem to find the answers to this, although this seems like an obvious question.

+4
source share
2 answers

As mentioned in the comments on the question, it System.Windows.Forms.Timerwill queue events Tick, blocking the user interface thread if all events Ticktake longer than the specified interval.

The event will continue to be calculated as long as necessary, regardless of the time interval.

, , , 1,3 , . , , 30 39 Tick.

, Timer, , .

+1

System.Windows.Forms.Timer (, ) , ( ), - ( ), .

, . , System.Threading.Timer, . , , System.Threading.Timer , .

System.Windows.Forms.Timer API Win32 SetTimer.

+1

Source: https://habr.com/ru/post/1589179/


All Articles