Using array of Action() in a lambda expression
<p>I want to do some performance measurement for a method that does some work with int arrays, so I wrote the following class:</p>

<pre><code>public class TimeKeeper
{
    public TimeSpan Measure(Action[] actions)
    {
        var watch = new Stopwatch();
        watch.Start();
        foreach (var action in actions)
        {
            action();
        }
        return watch.Elapsed;
    }
}
</code></pre>

<p>But I can not call the <code>Measure</code> mehotd for the example below:</p>

<pre><code>var elpased = new TimeKeeper();
elpased.Measure(
    () =&gt;
    new Action[]
        {
            FillArray(ref a, "a", 10000),
            FillArray(ref a, "a", 10000),
            FillArray(ref a, "a", 10000)
        });
</code></pre>

<p>I get the following errors:</p>

<pre><code>Cannot convert lambda expression to type 'System.Action[]' because it is not a delegate type
Cannot implicitly convert type 'void' to 'System.Action'
Cannot implicitly convert type 'void' to 'System.Action'
Cannot implicitly convert type 'void' to 'System.Action'
</code></pre>

<p>Here is the method that works with arrays:</p>

<pre><code>private void FillArray(ref int[] array, string name, int count)
{
    array = new int[count];

    for (int i = 0; i &lt; array.Length; i++)
    {
        array[i] = i;
    }

    Console.WriteLine("Array {0} is now filled up with {1} values", name, count);
}
</code></pre>

<p>What I am doing wrong?</p>
