From d794ac0e207efb0bbee20e5852be98e377e8e031 Mon Sep 17 00:00:00 2001 From: Michael Ossmann Date: Thu, 16 Feb 2017 14:47:53 -0700 Subject: [PATCH] output timestamps in microseconds --- host/hackrf-tools/src/hackrf_sweep.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/host/hackrf-tools/src/hackrf_sweep.c b/host/hackrf-tools/src/hackrf_sweep.c index 886618cb..d4e6d333 100644 --- a/host/hackrf-tools/src/hackrf_sweep.c +++ b/host/hackrf-tools/src/hackrf_sweep.c @@ -183,9 +183,6 @@ fftwf_complex *fftwOut = NULL; fftwf_plan fftwPlan = NULL; float* pwr; float* window; -time_t time_now; -struct tm *fft_time; -char time_str[50]; float logPower(fftwf_complex in, float scale) { @@ -202,11 +199,15 @@ int rx_callback(hackrf_transfer* transfer) { uint64_t band_edge; uint32_t record_length; int i, j; + struct timeval time_stamp; + struct tm *fft_time; + char time_str[50]; if(NULL == fd) { return -1; } + gettimeofday(&time_stamp, NULL); byte_count += transfer->valid_length; buf = (int8_t*) transfer->buffer; for(j=0; j