Move multiplexer foreign bindings to syscalls package.
[iolib.git] / io.multiplex / time.lisp
blob8fb4b5860cc00a0a73b036e5b22e63730351b96d
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
2 ;;;
3 ;;; --- Various time-related functions.
4 ;;;
6 (in-package :io.multiplex)
8 ;;;; Timeouts
10 (defun abs-timeout (timeout)
11 (+ (isys:%sys-get-monotonic-time) (normalize-timeout timeout)))
13 (defun min-timeout (&rest timeouts)
14 (let* ((good-timeout-start (member-if-not #'null timeouts))
15 (min (car good-timeout-start)))
16 (loop :for timeout :in (cdr good-timeout-start)
17 :if timeout :do
18 (setf min (if min (min min timeout) timeout))
19 :finally (return min))))