mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2025-04-21 12:27:27 +03:00
tools/lib/timeout.h, tools/lib/timeout.c: added timeout/deadline functions
This commit is contained in:
29
tools/lib/timeout.h
Normal file
29
tools/lib/timeout.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* lib/timeout.h - ATRF driver API
|
||||
*
|
||||
* Written 2011 by Werner Almesberger
|
||||
* Copyright 2011 Werner Almesberger
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef TIMEOUT_H
|
||||
#define TIMEOUT_H
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
|
||||
struct timeout {
|
||||
struct timeval end;
|
||||
};
|
||||
|
||||
|
||||
void timeout_start(struct timeout *t, int ms);
|
||||
int timeout_reached(const struct timeout *t);
|
||||
int timeout_left_ms(const struct timeout *t);
|
||||
|
||||
#endif /* !TIMEOUT_H */
|
||||
Reference in New Issue
Block a user