Easy Time Difference
Posted: Thu Sep 30, 2010 11:44 pm
So, I used to make a timer and do some annoying stuff to get the time difference between two events. I decided to just make it easier so I can call a function at the start of an event and the end to get the difference. Here is what I have.
Basically for some event, lets say...cheese:
storeTime("cheese")
then you can do this
diffTime("cheese") --Returns a string with the time in each increment that has changed, destroys the key
diffTime("cheese", true) --Same thing, but wont remove that event. Allows you to check elapsed time and keep it
diffTime("cheese", true, true) --Same as above, but returns a numerical difference in seconds elapsed
Basically for some event, lets say...cheese:
storeTime("cheese")
then you can do this
diffTime("cheese") --Returns a string with the time in each increment that has changed, destroys the key
diffTime("cheese", true) --Same thing, but wont remove that event. Allows you to check elapsed time and keep it
diffTime("cheese", true, true) --Same as above, but returns a numerical difference in seconds elapsed