Fix mstimer elapsed time (#58)

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2020-03-17 17:27:25 -05:00
committed by GitHub
parent 1b9c1ad3b3
commit f18612f1ec
9 changed files with 29 additions and 10 deletions
+15
View File
@@ -106,6 +106,21 @@ unsigned long mstimer_remaining(struct mstimer *t)
return t->start + t->interval - mstimer_now();
}
/**
* The time elapsed since the timer started
*
* This function returns the time elapsed.
*
* @param t A pointer to the timer
*
* @return The time elapsed since the last start of the timer
*
*/
unsigned long mstimer_elapsed(struct mstimer *t)
{
return mstimer_now() - t->start;
}
/**
* The value of the interval
*