Computer Communications Spring 1998
Later in the semester, you will need to write programs that use (1) system calls, and (2) various forms of timers to monitor the efficiency of certain network operations. This assignment is to refresh your C skills and start to learn a few system calls.
One simple system call available using Linux and also the HP system is the gettimeofday function. Another less simple system service is the getitimer & setitimer pair of functions. These two calls are also available on HP systems. There are yet other time-related system calls, and the command man -k time will display quite a number of them.
Two elementary programs illustrate some uses of gettimeofday and getitimer calls. The program reptime.c uses the gettimeofday call to report elapsed time in a program loop; the program reptimel.c also does this, but in a different way. To test these programs, follow these steps.