@glv I think I understood the idea behind the millis function. As you can see in the example code. However , as mentioned in the question, I was expecting a different time stamp once inside the if statement above . But when i console log it i get the same time stamp output . That is why i was confused .