]> rtime.felk.cvut.cz Git - can-benchmark.git/blobdiff - latester/latester.c
Fix shown number of lost messages and finish at most one second after the last messag...
[can-benchmark.git] / latester / latester.c
index f3ba4c60414b98ec7f3f0cc74ee8a2309b71d59c..619c2582838a59a86959dd035b16485c4597d383 100644 (file)
@@ -748,7 +748,8 @@ int main(int argc, const char *argv[])
                if (opt.count != 0 && count >= opt.count) {
                        if (allsent.tv_sec == 0)
                                allsent = now;
-                       if (now.tv_sec - allsent.tv_sec >= 2)
+                       timespec_subtract(&diff, &now, &allsent);
+                       if (diff.tv_sec >= 1)
                                finish_flag = 1;
                }
        }
@@ -774,7 +775,7 @@ int main(int argc, const char *argv[])
        if (stats.enobufs)
                printf("enobufs=%d\n", stats.enobufs);
        if (stats.lost)
-               printf("lost=%d\n", stats.enobufs);
+               printf("lost=%d\n", stats.lost);
 
        return 0;
 }