Added time left function.

FossilOrigin-Name: 9fa6601d10b08c28a7e6768ffeec0d5a5fc0413854e454a919503c5a775dd0d8
This commit is contained in:
7u83@mail.ru 2016-03-27 02:37:57 +00:00
parent 06784cab2a
commit d81dd13fa5
1 changed files with 7 additions and 0 deletions

View File

@ -55,6 +55,13 @@ typedef time_t cw_timer_t;
*/
#define cw_timer_timeout(t) (time(NULL)>(t) ? 1 : 0)
/**
* Get the number of seconds left in a timer
* @param t timer
* @return number of seconds
*/
#define cw_timer_timeleft(t) ((t)-time(NULL))
/**
* Get the number of nano seconds from a timeval.
*/