Timer after condition.

Hello people im really new to coding and arduino and i have a project atm. I have a thermocouple that reads water temperature and according to this temperature i must show a message after certain intervals. I have no problem with using thermocouple only the timer it starts as the arduino starts working but i need it to start after the condition is true. For this example; timer has to start after water temperature is 100 celcius and it should show message after 1 min then 2 min 50 sec and 4 min. Here is what i have so far:

if (ts.getCelsius()>100)
{
if(currentMillis-previousMillis < 1000)  
previousMillis = currentMillis;
if(millis() >= 0 && currentMillis<60000 )
{
display.println("Cooking");
}
if(currentMillis >= 60000 && currentMillis<170000 )
display.println("Soft"); 
}
if(currentMillis >= 170000 && currentMillis<240000 )
{
  display.println("Medium");
}
if(currentMillis >= 240000 && currentMillis<500000 ) 
{
   display.println("Hard");
}
}

Record the value of millis in a variable when the event happens. Use subtraction with the current value of millis to tell how long it has been since then.

if(millis() >= 0

Since millis() returns an unsigned long, I think you can count on it always being greater than or equal to zero. There should never be any need for a test like this.

if (ts.getCelsius()>100) // if condition for temperature.
{
unsigned long currentMillis = millis(); 
if(millis()-currentMillis<60000 )
{
display.println("Cooking");
}
if(millis()-currentMillis >= 60000 && millis()-currentMillis<170000 )  
{
display.println("Soft"); 
}
if(millis()-currentMillis >= 170000 && millis()-currentMillis<240000 ) 
{
  display.println("Medium");
}
if(millis()-currentMillis >= 240000 && millis()-currentMillis<500000 ) 
{
   display.println("Hard");
}
}

i have changed the code according to your suggestion but im making a mistake here. now it only says cooking im guessing it stores a new currentMillis every time condition is true ?

anyone ?

ecdd:
im guessing it stores a new currentMillis every time condition is true ?

Yes.

ecdd:
anyone ?

It's hard to tell from just this snippet how the rest of the code relates to it. Try posting the whole thing so maybe someone can make sense of what you are seeing.

Or take your snippet here: http://snippets-r-us.com/

The demo Several Things at a Time illustrates the use of millis() to manage timing.

...R