aboutsummaryrefslogtreecommitdiff
path: root/src/sg_turs.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2018-01-19 13:08:58 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2018-01-19 13:08:58 +0000
commit400444efd4e3c2cd758aee250556c84e052634dc (patch)
tree4db54605f35f18dc4d997263e0218974ecfba463 /src/sg_turs.c
parent239d147229acac3d3504360a38cd5ec8505d0d5e (diff)
downloadsg3_utils-400444efd4e3c2cd758aee250556c84e052634dc.tar.gz
add hex2stdout(), hex2stderr() and hex2str(); add testing/sg_tst_nvme; clean Makefile.freebsd in examples/ and testing/; NVMe error processing
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@745 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_turs.c')
-rw-r--r--src/sg_turs.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/sg_turs.c b/src/sg_turs.c
index f4ac2efa..2578378d 100644
--- a/src/sg_turs.c
+++ b/src/sg_turs.c
@@ -3,7 +3,7 @@
* data transfer (and no REQUEST SENSE command iff the unit is ready)
* then this can be used for timing per SCSI command overheads.
*
- * Copyright (C) 2000-2017 D. Gilbert
+ * Copyright (C) 2000-2018 D. Gilbert
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
@@ -33,7 +33,7 @@
#include "sg_pr2serr.h"
-static const char * version_str = "3.36 20171011";
+static const char * version_str = "3.37 20180116";
#if defined(MSC_VER) || defined(__MINGW32__)
#define HAVE_MS_SLEEP
@@ -369,7 +369,7 @@ main(int argc, char * argv[])
#ifndef SG_LIB_MINGW
if ((op->do_time) && (start_tm.tv_sec || start_tm.tv_usec)) {
struct timeval res_tm;
- double a, b;
+ double den, num;
gettimeofday(&end_tm, NULL);
res_tm.tv_sec = end_tm.tv_sec - start_tm.tv_sec;
@@ -378,13 +378,13 @@ main(int argc, char * argv[])
--res_tm.tv_sec;
res_tm.tv_usec += 1000000;
}
- a = res_tm.tv_sec;
- a += (0.000001 * res_tm.tv_usec);
- b = (double)op->do_number;
+ den = res_tm.tv_sec;
+ den += (0.000001 * res_tm.tv_usec);
+ num = (double)op->do_number;
printf("time to perform commands was %d.%06d secs",
(int)res_tm.tv_sec, (int)res_tm.tv_usec);
- if (a > 0.00001)
- printf("; %.2f operations/sec\n", b / a);
+ if (den > 0.00001)
+ printf("; %.2f operations/sec\n", num / den);
else
printf("\n");
}