/* * Copyright (C) 1997-2000 SpellCaster Telecommunications Inc. * $Id: load.c,v 1.1 2004/03/11 03:59:32 bcrl Exp $ * Released under the GNU Public License. See LICENSE file for details. */ #include #include #include int main(void) { struct timeval last, tv; long delta, counter = 0; gettimeofday(&last, NULL); for (;;) { counter ++; gettimeofday(&tv, NULL); delta = (tv.tv_sec - last.tv_sec) * 1000000; delta += (tv.tv_usec - last.tv_usec); if (delta >= 2000000) { printf("Delta: %9ld Counter: %9ld\n", delta, counter); last = tv; counter = 0; } } }