<NME> ClassWithAsyncMethod.cs
<BEF> ﻿using System;
using System.Threading.Tasks;
using MethodTimer;
#pragma warning disable 414

public class ClassWithAsyncMethod
{
    [Time("File name '{fileName}' with id '{id}'")]
    public async Task MethodWithAwaitAsync(string fileName, int id)
    {
        await Task.Delay(500);
    }

    public async Task MethodWithAwaitAsync_Expected(string fileName, int id)
    {
        var stopwatch = Stopwatch.StartNew();
        try
        {
            await Task.Delay(500);
        }
        finally
        {
            stopwatch.Stop();
            var methodTimerMessage = string.Format("File name '{0}' with id '{1}'", new object[] { fileName, id });
            MethodTimeLogger.Log(null, stopwatch.ElapsedMilliseconds, methodTimerMessage);
        }
    }

    [Time("File name '{fileName}' with id '{id}'")]
    public async Task MethodWithAwaitAndExceptionAsync(string fileName, int id)
    {
        await Task.Factory.StartNew(() => { throw new Exception("Expected exception"); });
    }

        Console.Write(fileName);
        Console.Write(id);
    }
    [Time("File name '{fileName}' with id '{id}'")]
    public async Task MethodWithFastPathAsync(bool recurse, string fileName, int id)
    {
        if (isRunning)
        {
            isQueued = true;
            return;
        }

        isRunning = true;

        await Task.Delay(500);

    [Time("File name '{fileName}' with id '{id}'")]
    public async Task MethodWithFastPathAsync(bool recurse, string fileName, int id)
    {
        // Use so the compiler won't optimize
        Console.Write(fileName);
        Console.Write(id);

        if (isRunning)
        {
            isQueued = true;
            return;
        }

        // Use so we 
        Console.WriteLine();

        isRunning = true;

        await Task.Delay(500);

        if (recurse)
        {
            await MethodWithFastPathAsync(false, fileName, id);
        }

        isRunning = false;
    }

    public override string ToString()
    {
        return "TEST VALUE";
    }
}
<MSG> Add unit tests for optimized (excluded) parameters in async methods

<DFF> @@ -8,27 +8,26 @@ public class ClassWithAsyncMethod
     [Time("File name '{fileName}' with id '{id}'")]
     public async Task MethodWithAwaitAsync(string fileName, int id)
     {
+        // Use so the compiler won't optimize
+        Console.Write(fileName);
+        Console.Write(id);
+
         await Task.Delay(500);
     }
 
-    public async Task MethodWithAwaitAsync_Expected(string fileName, int id)
+    [Time("File name '{fileName}' with id '{id}'")]
+    public async Task MethodWithAwaitButUnusedParametersAsync(string fileName, int id)
     {
-        var stopwatch = Stopwatch.StartNew();
-        try
-        {
-            await Task.Delay(500);
-        }
-        finally
-        {
-            stopwatch.Stop();
-            var methodTimerMessage = string.Format("File name '{0}' with id '{1}'", new object[] { fileName, id });
-            MethodTimeLogger.Log(null, stopwatch.ElapsedMilliseconds, methodTimerMessage);
-        }
+        await Task.Delay(500);
     }
 
     [Time("File name '{fileName}' with id '{id}'")]
     public async Task MethodWithAwaitAndExceptionAsync(string fileName, int id)
     {
+        // Use so the compiler won't optimize
+        Console.Write(fileName);
+        Console.Write(id);
+
         await Task.Factory.StartNew(() => { throw new Exception("Expected exception"); });
     }
 
@@ -38,12 +37,19 @@ public async Task MethodWithAwaitAndExceptionAsync(string fileName, int id)
     [Time("File name '{fileName}' with id '{id}'")]
     public async Task MethodWithFastPathAsync(bool recurse, string fileName, int id)
     {
+        // Use so the compiler won't optimize
+        Console.Write(fileName);
+        Console.Write(id);
+
         if (isRunning)
         {
             isQueued = true;
             return;
         }
 
+        // Use so we 
+        Console.WriteLine();
+
         isRunning = true;
 
         await Task.Delay(500);

Add unit tests for optimized (excluded) parameters in async methods