# HG changeset patch # User jbe # Date 1452915473 -3600 # Node ID 6bcdddff1ddd622ce11a273eebd5de597f2e2270 # Parent e8084e64aa9105778a123b98f827d610097ef206 Added missing documentation for moonbridge_io.timeref(...) function diff -r e8084e64aa91 -r 6bcdddff1ddd reference.txt --- a/reference.txt Sat Jan 16 04:18:27 2016 +0100 +++ b/reference.txt Sat Jan 16 04:37:53 2016 +0100 @@ -424,6 +424,27 @@ for moonbridge.io_locallisten(...). +### moonbridge_io.timeref(previous) + +Helper function which returns a time reference (in SI-seconds). If a value is +passed as an optional argument to the function, then that value is substracted +from the result. A common idiom is: + + local starttime = moonbridge_io.timeref() + [...] + while true do + [...] + if not moonbridge_io.poll( + input_set, + output_set, + timeout - moonbridge_io.timeref(starttime) + ) then + error("Timeout or signal received!") + end + [...] + end + + HTTP module -----------