Example:
var timer1 = new Timer(_ => Console.WriteLine("Hello World"), null, 0, 2000);
Example:
var timer1 = new Timer(_ => Console.WriteLine("Hello World"), null, 0, 2000);
Begining with C# 7.0, C# started to support discards. _ is consider discards which are basically a placeholder variables that are intentionally unused in application code. Starting with C# 9.0, you can also use discards to specify unused input parameters of a lambda expression (like in your example).
discards are basically just a way to intentionally ignore irrelevant local variables for the purposes of the code that is being produced.So, for example when you call a function that returns a value but you are only interested in the underlying operations it does, you don't have to assign its output to a local variable defined in the caller method.
Because there can only be a single discard variable, that variable may not even be allocated storage so Discards can actually reduce memory allocations while also making the intent of your code clearer, enhance its readability and maintainability.
When _ is a valid discard, trying to access its value or modify it in an assignment operation will generate a compiler error ("The name '_' doesn't exist in the current context"). This error is being generated because _ isn't assigned a value, and may not be assigned a storage location.
More about Discards can be read in this link