Timed input

Frank I. Reiter frank at rsoft.UUCP
Mon Jan 9 02:24:19 AEST 1989


In article <8800006 at gistdev> flint at 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.



More information about the Comp.unix.wizards mailing list