Added time left function.
FossilOrigin-Name: 9fa6601d10b08c28a7e6768ffeec0d5a5fc0413854e454a919503c5a775dd0d8
This commit is contained in:
		| @ -55,6 +55,13 @@ typedef time_t cw_timer_t; | |||||||
|  */ |  */ | ||||||
| #define cw_timer_timeout(t) (time(NULL)>(t) ? 1 : 0) | #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. |  * Get the number of nano seconds from a timeval. | ||||||
|  */ |  */ | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user