summaryrefslogtreecommitdiffstats
path: root/tools.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2011-12-09 08:24:01 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2011-12-09 08:24:01 +0100
commit097edb90b7826ad7557777cc102de2630f235141 (patch)
tree9b3c89fb7e576691356460ae134fe9be5bbf0500 /tools.c
parentde31339c3382d32be9c4440466b1d01e40e0d0b3 (diff)
downloadpcitool-097edb90b7826ad7557777cc102de2630f235141.tar.gz
pcitool-097edb90b7826ad7557777cc102de2630f235141.tar.bz2
pcitool-097edb90b7826ad7557777cc102de2630f235141.tar.xz
pcitool-097edb90b7826ad7557777cc102de2630f235141.zip
Gathering a bit of statistics
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c4
1 files changed, 4 insertions, 0 deletions
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;