Skip to content

Commit c463de9

Browse files
committed
Fix in CTF reader timing report
1 parent 3ffef93 commit c463de9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Detectors/CTF/workflow/src/CTFReaderSpec.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,14 +301,14 @@ void CTFReaderSpec::processTF(ProcessingContext& pc)
301301

302302
// do we need to way to respect the delay ?
303303
long tNow = std::chrono::time_point_cast<std::chrono::microseconds>(std::chrono::system_clock::now()).time_since_epoch().count();
304-
auto tDiff = tNow - mLastSendTime;
305304
if (mCTFCounter) {
305+
auto tDiff = tNow - mLastSendTime;
306306
if (tDiff < mInput.delay_us) {
307307
pc.services().get<RawDeviceService>().waitFor((mInput.delay_us - tDiff) / 1000); // respect requested delay before sending
308308
}
309309
}
310310
tNow = std::chrono::time_point_cast<std::chrono::microseconds>(std::chrono::system_clock::now()).time_since_epoch().count();
311-
LOGP(info, "Read CTF {} {} in {:.3f} s, {:.4f} s elapsed from previous CTF", mCTFCounter, entryStr, mTimer.CpuTime() - cput, 1e-6 * (tNow - mLastSendTime));
311+
LOGP(info, "Read CTF {} {} in {:.3f} s, {:.4f} s elapsed from previous CTF", mCTFCounter, entryStr, mTimer.CpuTime() - cput, mCTFCounter ? 1e-6 * (tNow - mLastSendTime) : 0.);
312312
mLastSendTime = tNow;
313313
mCTFCounter++;
314314
}

0 commit comments

Comments
 (0)