Asynchronous Serial Communications Programmer's Reference Manual (32022-90052)

68 Chapter3
Common Device Control Functions
Reading From Asynchronous Devices
Timing a Read
On MPE/iX systems every read that occurs is timed; there is never a
need to turn a timer on to obtain information about the length of a read.
However, the result of the timer is not actually returned to your
program unless you explicitly issue an FCONTROL call, using 22 as the
value of the controlcode parameter. This FCONTROL call returns the
time used for the immediately preceding read as the value of param.
The time of the read is returned in hundredths of a second, up to a limit
of 655.35 seconds. This limit is imposed by the 16-bit capacity of
param. If the read being timed took longer than 655.35 seconds to
complete, the FCONTROL call returns a CCG condition. A call to
FCHECK would return an FSERR 98, Read Timer Overflow.
The code fragment shown in Figure 3-3 posts a read against
fileid_in
and issues a call to FCONTROL(22) immediately after the
read to obtain the results of the read timer. After execution of the
FCONTROL call, read_time will contain the results of the timer and
the program will write this value to the standard output device. The
code sample also checks for a CCE condition, which would indicate that
the FCONTROL had succeeded.