Beispiel #1
0
        public static double GetHashRate(string gpuChipset, string algorithm, int numOfGPU)
        {
            string        key       = gpuChipset + "_" + algorithm;
            HashPowerInfo powerInfo = GetHashPowerInfo(gpuChipset, algorithm);

            if (powerInfo != null)
            {
                return(powerInfo.Power * numOfGPU);
            }
            else
            {
                System.Diagnostics.Debug.WriteLine(string.Format("Not found hashrate of gpu {0} on algorithm {1},", gpuChipset, algorithm));
                return(0);
            }
        }
Beispiel #2
0
        public static double GetAlgorithmHashRate(string algorithm)
        {
            if (_hardwareOnHand.Count == 0)
            {
                throw new Exception("Hardware is empty. Please use SetupHardware method before call GetAlgorithmHashRate method.");
            }
            double totalHashRate = 0.0D;

            foreach (KeyValuePair <string, int> hardware in _hardwareOnHand)
            {
                HashPowerInfo powerInfo = GetHashPowerInfo(hardware.Key, algorithm);
                if (powerInfo != null)
                {
                    totalHashRate += powerInfo.Power * hardware.Value;
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine(string.Format("Not found hashrate of gpu {0} on algorithm {1},", hardware.Key, algorithm));
                }
            }
            return(totalHashRate);
        }