'What's the difference between CancellationTokenSource constructor delay parameter and CancelAfter Method

Given these two approaches

var cts = new CancellationTokenSource(TimeSpan.FromMinutes(1));
var cts = new CancellationTokenSource();
cts.CancelAfter(TimeSpan.FromMinutes(1));

Is there any real difference in behaviour?

The only slight of information is on MS docs but it's not clear since quoting

Subsequent calls to CancelAfter will reset the delay for this CancellationTokenSource, if it has not been canceled already.

So I guess it resets it but does it have any other action regardles?



Solution 1:[1]

According to the source, nothing. They both assign to m_timer

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Daniel A. White