Rude? Wrong word choice. Lazy might be a better option. LOL
here is the snippet that got me there:
//void time_elapse() //--(For cycle only)--
{
DateTime now = rtc.now();
timeStart = ((now.hour() * 60 * 60) + (now.minute() * 60) + now.second()); //--(Convert time to seconds)--
if (timeElapse1 == 0)
{
elapsetime = timeStart; //--(Save variable for calculation on first call of function)--
timeElapse1 = 1; //--(toggle elapse time variable to stop cycle timer on next function call)--
return;
}
if (timeElapse1 == 1)
{
elapsetime = timeStart - elapsetime; //--(calculate in seconds how long a piece of code took to run)--
lcd.setCursor(11, 1);
lcd.write("Cycle=");
lcd.print(elapsetime);
lcd.write("s");
timeElapse1 = 0; //--(toggle elapse time variable to start cycle timer on next function call)--
elapsetime = 0; //--(zero out variable for next use)--
return;
}
}
Hope this is helpful