alarm - set time limit


unsigned u;

int getalarm()


Setalarm sets an alarm interrupt for u seconds.  If u seconds elapse before the alarm is cleared, an interrupt occurs.  If u is zero, the alarm is cleared.  The alarm interrupt is used (see alarm(2)).  Only one alarm can be maintained with this facility; however, in consideration of other alarm users, the time remaining on a pre-existing alarm is maintained but the interrupt is postponed until this alarm is cleared.  This function is used during read operations to limit blocking. 

Getalarm returns non-zero if the alarm has gone off.  Getalarm is only valid while the alarm is set.  This function is used within read loops to limit blocking. 


inkeyS(io), linein(io), inputS(io)
alarm(2) in the UNIX Programmerís Manual

from The Basmark QuickBASIC Programmerís Manual by Lawrence Leinweber