I am trying to identify how many seconds have passed since an action occurred. For example, I receive a message and I set a variable when it is received. When 45 seconds have passed, I want to perform some other action.
The problem is that when I use my calculation, the seconds go from 0-59, and then start back at 0. I am trying to find a calculation that will show me a result of 60 or more seconds. Below is an example of what I'm currently doing:
lastMessageReceived = DateTime.Now
If DateTime.Now.Subtract(lastMessageReceived).Seconds > 45 Then
When I do this, the result I get when calculating the difference in lastMessageReceived and DateTime.Now is 15 seconds instead of 65 seconds.
Is there another calculation that will show me total seconds, and not reset after it reaches 59?