Skip to content

Commit 6083350

Browse files
HPCC-33587 Add option to set minimum query execution time
Changes following review Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
1 parent 323f176 commit 6083350

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

roxie/ccd/ccdcontext.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -2623,10 +2623,11 @@ class CRoxieServerContext : public CRoxieContextBase, implements IRoxieServerCon
26232623
{
26242624
logctx.mergeStats(0, globalStats);
26252625
unsigned __int64 elapsed = elapsedTimer.elapsedNs();
2626-
if (nanoToMilli(elapsed) < options.minTimeLimit)
2626+
unsigned __int64 minTime = milliToNano(options.minTimeLimit);
2627+
if (nanoToMilli(elapsed) < minTime)
26272628
{
2628-
unsigned delay = options.minTimeLimit - nanoToMilli(elapsed);
2629-
MilliSleep(delay);
2629+
unsigned __int64 delay = minTime - elapsed;
2630+
MilliSleep(nanoToMilli(delay)); // nano sleep would be better?
26302631
logctx.noteStatistic(StTimeDelayed, delay);
26312632
}
26322633
logctx.setStatistic(StTimeTotalExecute, elapsed); // Should this include delay?

0 commit comments

Comments
 (0)