Path: utzoo!attcan!uunet!lll-winken!ames!ncar!boulder!sunybcs!rutgers!att!alberta!ubc-cs!van-bc!rsoft!frank From: frank@rsoft.UUCP (Frank I. Reiter) Newsgroups: comp.unix.wizards Subject: Re: Timed input Summary: Use alarm() Message-ID: <11@rsoft.UUCP> Date: 8 Jan 89 16:24:19 GMT References: <19@xenlink.UUCP> <8800006@gistdev> Reply-To: frank@rsoft.UUCP (Frank I. Reiter) Organization: Reiter Software Inc., British Columbia Canada Lines: 10 In article <8800006@gistdev> flint@gistdev.UUCP writes: > >(For example, if I want my user >to type as many keys as they want to within 10 seconds, and then evaluate >that amount of input, I'm stuck: I have to change the timelimit with each >successive keypress to be "10 - time_used_so_far", and the only way to do >so is with an incredibly slow ioctl() call on each keypress. Set an alarm for 10 seconds and then read the characters using read() or fgetc() or whatever you like until the alarm goes off.