mirror of https://github.com/octoleo/lsyncd.git
structering the core some more
This commit is contained in:
parent
902b2c77cd
commit
4af469854e
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
| time.h from Lsyncd -- the Live (Mirror) Syncing Demon
|
||||
|
|
||||
|
|
||||
| Time keeping.
|
||||
|
|
||||
|
|
||||
| License: GPLv2 (see COPYING) or any later version
|
||||
| Authors: Axel Kittenberger <axkibe@gmail.com>
|
||||
*/
|
||||
#ifndef LSYNCD_TIME_H
|
||||
#define LSYNCD_TIME_H
|
||||
|
||||
// time comparisons - wrap around safe
|
||||
#define time_after(a,b) ((long)(b) - (long)(a) < 0)
|
||||
#define time_before(a,b) time_after(b,a)
|
||||
#define time_after_eq(a,b) ((long)(a) - (long)(b) >= 0)
|
||||
#define time_before_eq(a,b) time_after_eq(b,a)
|
||||
|
||||
// Returns the current time.
|
||||
extern clock_t now( );
|
||||
|
||||
// Returns (on Lua stack) the current kernels clock state( jiffies ).
|
||||
extern int l_now(lua_State *L);
|
||||
|
||||
// Registers the jiffies meta table in a Lua state.
|
||||
extern void register_jiffies( lua_State *L );
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue