Hi,
There are technical ways to calculate the time taken by loop. We can do that by integrating instruction time as per datasheet of microcontroller. But let me show you the simplest way, as you have a LCD for display, just take one more variable and add it at the end of the code, like
"
unsigned int test_time, test_sec;
..........code.......
test_time++;
if(test_time > 1000)
{
test_time = 0;
test_sec++;
display(test_sec);
}
......as simple as that, Yes that is true it might add some instruction but thats ok we will get approximate timing.
}