home *** CD-ROM | disk | FTP | other *** search
/ nisttime.carsoncity.k12.mi.us / nisttime.carsoncity.k12.mi.us.tar / nisttime.carsoncity.k12.mi.us / pub / lockclock / testj.c < prev    next >
C/C++ Source or Header  |  1996-11-18  |  475b  |  26 lines

  1. main()
  2. {
  3. double xx;
  4. int adtj();
  5.     xx= -1;
  6.     adjt(xx);
  7. }
  8. int adjt(xx)
  9. double xx;
  10. {
  11. /*
  12.     this subroutine adjusts the time of the local clock
  13.     by xx seconds, where a positive value advances the
  14.     time and a negative value retards it.
  15. */
  16. #include <sys/time.h>
  17. #include "sizint.h"
  18. struct timeval delta;
  19. struct timeval olddelta;
  20. int j;
  21.     delta.tv_sec=(LONG) xx;
  22.     delta.tv_usec=(LONG)(1000000l*(xx-delta.tv_sec));
  23.     printf(" sec, usec= %ld %ld",delta.tv_sec,delta.tv_usec);
  24.     return(1);
  25. }
  26.