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 >
Wrap
C/C++ Source or Header
|
1996-11-18
|
475b
|
26 lines
main()
{
double xx;
int adtj();
xx= -1;
adjt(xx);
}
int adjt(xx)
double xx;
{
/*
this subroutine adjusts the time of the local clock
by xx seconds, where a positive value advances the
time and a negative value retards it.
*/
#include <sys/time.h>
#include "sizint.h"
struct timeval delta;
struct timeval olddelta;
int j;
delta.tv_sec=(LONG) xx;
delta.tv_usec=(LONG)(1000000l*(xx-delta.tv_sec));
printf(" sec, usec= %ld %ld",delta.tv_sec,delta.tv_usec);
return(1);
}