timedFn : measurement delay is programmable

instead of hard-coded 1 second per measurement
This commit is contained in:
Yann Collet
2018-08-28 11:26:27 -07:00
parent 0ff9b67552
commit 55affc09de
5 changed files with 54 additions and 36 deletions
+2 -1
View File
@@ -514,10 +514,11 @@ static size_t benchMem(U32 benchNb,
{ size_t i; for (i=0; i<dstBuffSize; i++) dstBuff[i]=(BYTE)i; }
/* benchmark loop */
{ BMK_timedFnState_t* const tfs = BMK_createTimedFnState(g_nbIterations);
{ BMK_timedFnState_t* const tfs = BMK_createTimedFnState(g_nbIterations * 1000, 1000);
BMK_runTime_t bestResult;
bestResult.sumOfReturn = 0;
bestResult.nanoSecPerRun = (unsigned long long)(-1LL);
assert(tfs != NULL);
for (;;) {
void* const dstBuffv = dstBuff;
BMK_runOutcome_t const bOutcome =