Ignore:
Timestamp:
Dec 23, 2010, 4:19:52 PM (11 years ago)
Author:
schwittmann
Message:

ExternalClient: Display progress for each subbatch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher/ExternalClient/Cryptool.cpp

    r2230 r2256  
    101101   
    102102    localCosts = new float[subbatch];
     103    lastSubbatchCompleted = clock();
     104
     105    // required for thousand/million separator in printf
     106    setlocale(LC_ALL,"");
    103107}
    104108
     
    282286    for (int i = 0; i < (size/subbatch); i++)
    283287    {
    284         enqueueSubbatch(queue, keybuffer, costs, i*subbatch, subbatch, j);
     288        enqueueSubbatch(queue, keybuffer, costs, i*subbatch, subbatch, j);
     289
     290        clock_t now = clock();
     291        clock_t timeDiff = now - lastSubbatchCompleted;
     292        lastSubbatchCompleted = now;
     293        printf("% .2f%% done. %'u keys/sec\n", ((i+1)*subbatch)/(float)size*100, (unsigned int)(subbatch/(timeDiff/(float)CLOCKS_PER_SEC)));
    285294    }
    286295
     
    288297    if (remain != 0)
    289298    {
    290         enqueueSubbatch(queue, keybuffer, costs, size-remain, remain, j);
     299        enqueueSubbatch(queue, keybuffer, costs, size-remain, remain, j);
    291300    }
    292301}
Note: See TracChangeset for help on using the changeset viewer.