using System.Threading.Tasks;
public static void Main()
Console.WriteLine("working ");
public static async Task SelectMABDdate(){
var task = EnterMabd("December 2017");
if (await Task.WhenAny(task, Task.Delay(timeout)) == task) {
Console.WriteLine("EnterMabd() Returned Within Time => EnterMabd() returned true");
throw new TimeoutException("it timed out");
public static async Task<bool> EnterMabd(string monthYear)
int nonLocalVariable = 0;
string elem = "" + nonLocalVariable;
Func<string, bool> add = x =>
elem = "" + nonLocalVariable++;