From 097edb90b7826ad7557777cc102de2630f235141 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Fri, 9 Dec 2011 08:24:01 +0100 Subject: Gathering a bit of statistics --- tools.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools.c') diff --git a/tools.c b/tools.c index 4874f7f..c673258 100644 --- a/tools.c +++ b/tools.c @@ -310,6 +310,10 @@ int pcilib_sleep_until_deadline(struct timeval *tv) { return 0; } +pcilib_timeout_t pcilib_timediff(struct timeval *tvs, struct timeval *tve) { + return ((tve->tv_sec - tvs->tv_sec)*1000000 + (tve->tv_usec - tvs->tv_usec)); +} + int pcilib_timecmp(struct timeval *tv1, struct timeval *tv2) { if (tv1->tv_sec > tv2->tv_sec) return 1; else if (tv1->tv_sec > tv2->tv_sec) return -1; -- cgit v1.2.3