From cf718f207111bb1db1286814a1a6cc6ad76bc522 Mon Sep 17 00:00:00 2001 From: dmiller Date: Mon, 28 Oct 2024 23:11:52 +0000 Subject: [PATCH] Avoid a few extra gettimeofday calls --- scan_engine.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scan_engine.cc b/scan_engine.cc index 1d5bcecd2..5c45e7b62 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -2519,9 +2519,11 @@ static void printAnyStats(UltraScanInfo *USI) { const HostScanStats *hss; struct ultra_timing_vals hosttm; + gettimeofday(&USI->now, NULL); + /* Print debugging states for each host being scanned */ if (o.debugging > 2) { - log_write(LOG_PLAIN, "**TIMING STATS** (%.4fs): IP, probes active/freshportsleft/retry_stack/outstanding/retranwait/onbench, cwnd/ssthresh/delay, timeout/srtt/rttvar/\n", o.TimeSinceStart()); + log_write(LOG_PLAIN, "**TIMING STATS** (%.4fs): IP, probes active/freshportsleft/retry_stack/outstanding/retranwait/onbench, cwnd/ssthresh/delay, timeout/srtt/rttvar/\n", o.TimeSinceStart(&USI->now)); log_write(LOG_PLAIN, " Groupstats (%d/%d incomplete): %d/*/*/*/*/* %.2f/%d/* %d/%d/%d\n", USI->numIncompleteHosts(), USI->numInitialHosts(), USI->gstats->num_probes_active, USI->gstats->timing.cwnd, @@ -2794,11 +2796,9 @@ void ultra_scan(std::vector &Targets, const struct scan_lists *ports, memory consumption reasons */ doAnyRetryStackRetransmits(&USI); doAnyNewProbes(&USI); - gettimeofday(&USI.now, NULL); // printf("TRACE: Finished doAnyNewProbes() at %.4fs\n", o.TimeSinceStartMS(&USI.now) / 1000.0); printAnyStats(&USI); waitForResponses(&USI); - gettimeofday(&USI.now, NULL); // printf("TRACE: Finished waitForResponses() at %.4fs\n", o.TimeSinceStartMS(&USI.now) / 1000.0); processData(&USI);