english
version "1.0"
identify "%Z%%M% %I% %E%"

#: Copyright (c) 1997-2005 by Wayne C. Gramlich.
#, All rights reserved.

module delay

#: This module provides a safe way for a program to sleep.

#FIXME:  All these routines should be reimplemented using the select(2)
#, system call!!!

define delay			#: Delay object
    record	
	unix_system unix_system
    generate address_get, allocate, erase



procedure create@delay
    takes_nothing
    returns delay

    #: This procedure will create and return a delay object.


procedure sleep@delay
    takes
	delay delay
	microseconds unsigned
    returns_nothing

    #: This procedure will cause the current process to sleep for
    #, {microseconds} number of microseconds using {delay}.


procedure print@delay
    takes
	delay delay
	out_stream out_stream
    returns_nothing

    #: This procedure will print a representation of {delay} to {out_stream}.