Im sure this has a very simple solution, but I am very bad at this... I want the "time up!" text to display only after the 2 min timer, as appose to both when it begins and after the 2 mins, I thought a bool would do it, but i cant get it to work, i think its to do with the "static void" "public void" stuff but im not sure, any help would be massively appreciated!
class Program
{
bool a = false;
static void Main(string[] args)
{
//Define thread
Console.WriteLine("Start, you have 2 mins!");
//120000 is milliseconds, so every 120 seconds it will run the thread function
System.Threading.Timer threadingTimer = new Timer(run, 0, 0, 120000);
a = true;
Console.ReadLine();
}
//define thread function
public void run(object args)
{
if (a = true)
{
Console.WriteLine("Times Up!");
}
}
}
if there is a simpler way of achiving this then that is also appreciated, thanks for taking a look!