#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>

int main() {
	struct timeval tv, otv;

	tv.tv_sec = 0;
	tv.tv_usec = 100000;

	while (1) {
		if (adjtime(&tv, &otv)) {
			printf("fail\n");
			return 1;
		}
		printf("%ld\n", tv.tv_usec - otv.tv_usec);
		sleep(1);
	}

	return 0;
}
