summaryrefslogtreecommitdiff
path: root/ev.c
diff options
context:
space:
mode:
authorroot <root>2011-01-17 12:11:11 +0000
committerroot <root>2011-01-17 12:11:11 +0000
commit2433d34aa31bda69b3b28888ac035e1dc08663e3 (patch)
tree89dce4e81f7e5579b0d6c4c779db367f8219a8f4 /ev.c
parentf00667682ef34d61b3f0f77e5bc3983fc40c55ef (diff)
*** empty log message ***
Diffstat (limited to 'ev.c')
-rw-r--r--ev.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ev.c b/ev.c
index 1a8b319..dbac270 100644
--- a/ev.c
+++ b/ev.c
@@ -817,6 +817,14 @@ ev_sleep (ev_tstamp delay)
}
}
+inline_speed int
+ev_timeout_to_ms (ev_tstamp timeout)
+{
+ int ms = timeout * 1000. + .999999;
+
+ return expect_true (ms) ? ms : timeout < 1e-6 ? 0 : 1;
+}
+
/*****************************************************************************/
#define MALLOC_ROUND 4096 /* prefer to allocate in chunks of this size, must be 2**n and >> 4 longs */