Fix mstimer elapsed time (#58)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
@@ -59,6 +59,8 @@ int mstimer_expired(struct mstimer *t);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned long mstimer_remaining(struct mstimer *t);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned long mstimer_elapsed(struct mstimer *t);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned long mstimer_interval(struct mstimer *t);
|
||||
/* HAL implementation */
|
||||
BACNET_STACK_EXPORT
|
||||
|
||||
Reference in New Issue
Block a user