BitCoinClient.Worker.WorkThread C# (CSharp) Méthode

WorkThread() public méthode

public WorkThread ( ) : void
Résultat void
        void WorkThread()
        {
            long startTime, endTime, freq;
            Win32Wrapper.QueryPerformanceFrequency(out freq);
            double dfFreq = 1.0 / (double)freq;
            while (true)
            {
                if (mDoWork)
                {
                    uint hashesRemaining = mHashCount - mHashesDone;
                    uint numHashes = Math.Min(hashesRemaining, cHashChunk);

                    uint start = mHashStart + mHashesDone;

                    Win32Wrapper.QueryPerformanceCounter(out startTime);
                    uint hashesDone = DoHashes(start, numHashes);
                    Win32Wrapper.QueryPerformanceCounter(out endTime);
                    double seconds = (double)(endTime - startTime) * dfFreq;
                    mHashrate = (double)hashesDone / seconds;

                    mHashesDone += hashesDone;
                    if (mHashesDone >= mHashCount)
                    {
                        // Done, didnt find a solution
                        SendWorkComplete(false, 0, mHashesDone);
                    }
                }
            }
        }