statzone

DNS zone file analyzer targeted at TLD zones
Log | Files | Refs | README | LICENSE

commit 078e9361d75bfb22a49dfdc1de3c0e0ae03c9f48
parent 7328f0d31434acff383dbf3669b33efcb1754f2d
Author: Frederic Cambus <fred@statdns.com>
Date:   Wed, 10 Jun 2020 16:26:37 +0200

Move elapsed time calculation in the displaySummary() function.

Diffstat:
Msrc/statzone.c | 13+++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/statzone.c b/src/statzone.c @@ -75,6 +75,13 @@ displayUsage() void displaySummary() { + /* Stopping timer */ + clock_gettime(CLOCK_MONOTONIC, &end); + + timespecsub(&end, &begin, &elapsed); + results.runtime = elapsed.tv_sec + elapsed.tv_nsec / 1E9; + + /* Print summary */ fprintf(stderr, "Processed %" PRIu64 " lines in %f seconds.\n", results.processedLines, results.runtime); } @@ -244,12 +251,6 @@ main(int argc, char *argv[]) if (results.domains) results.domains--; - /* Stopping timer */ - clock_gettime(CLOCK_MONOTONIC, &end); - - timespecsub(&end, &begin, &elapsed); - results.runtime = elapsed.tv_sec + elapsed.tv_nsec / 1E9; - /* Printing CVS values */ fprintf(stdout, "---[ CSV values ]--------------------------------------------------------------\n"); fprintf(stdout, "IPv4 Glue,IPv6 Glue,NS,Unique NS,DS,Signed,IDNs,Domains\n");