3 * Copyright 2006 Free Software Foundation, Inc.
5 * This file is part of GNU Radio.
7 * Primary Author: Michael Dickens, NCIP Lab, University of Notre Dame
9 * GNU Radio is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2, or (at your option)
14 * GNU Radio is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with GNU Radio; see the file COPYING. If not, write to
21 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, USA.
25 #include <sys/types.h>
26 #include <mld_timer.h>
28 void start_timer (struct timeval *t_tp)
30 gettimeofday (t_tp, 0);
33 u_long end_timer (struct timeval *g_tp)
36 gettimeofday (&t_tp, 0);
38 u_long retVal = (t_tp.tv_sec - g_tp->tv_sec);
41 if (t_tp.tv_usec < g_tp->tv_usec) {
43 df_usec = 1000000 - (g_tp->tv_usec - t_tp.tv_usec);
45 df_usec = t_tp.tv_usec - g_tp->tv_usec;