tftp-hpa-0.35 and tftp-hpa-0.36 show wrong transmission time.
>tftp -V
tftp-hpa 0.36, with readline>tftp -m octet -v localhost -c get aaa /tmp/aaa
Connected to localhost.localdomain (127.0.0.1), port 69
getting from localhost.localdomain:aaa to /tmp/aaa [octet]
Received 33554432 bytes in -3.3 seconds [-81407477 bit/s]
^^^^ ^^^^^^^^^
By the way, why don't you use timersub() or something like it?
--- tftp-hpa-0.36.org/tftp/tftp.c 2004-01-09 05:47:00.000000000 +0900
+++ tftp-hpa-0.36/tftp/tftp.c 2004-02-18 22:17:27.000000000 +0900
@@ -422,8 +422,8 @@
{
double delta;
- delta = (tstop.tv_sec+(tstop.tv_usec/100000.0)) -
- (tstart.tv_sec+(tstart.tv_usec/100000.0));
+ delta = (tstop.tv_sec+(tstop.tv_usec/1000000.0)) -
+ (tstart.tv_sec+(tstart.tv_usec/1000000.0));
if (verbose) {
printf("%s %lu bytes in %.1f seconds", direction, amount, delta);
printf(" [%.0f bit/s]", (amount*8.)/delta);
----
Hideki IWAMOTO h-iwamoto at kit.hi-ho.ne.jp