示例#1
0
        protected override void BenchmarkThreadRoutineStartSettup()
        {
            // sgminer extra settings
            AlgorithmType NHDataIndex = BenchmarkAlgorithm.NiceHashID;

            if (Globals.NiceHashData == null)
            {
                Helpers.ConsolePrint("BENCHMARK", "Skipping sgminer benchmark because there is no internet " +
                                     "connection. Sgminer needs internet connection to do benchmarking.");

                throw new Exception("No internet connection");
            }

            if (Globals.NiceHashData[NHDataIndex].paying == 0)
            {
                Helpers.ConsolePrint("BENCHMARK", "Skipping sgminer benchmark because there is no work on Nicehash.com " +
                                     "[algo: " + BenchmarkAlgorithm.GetName() + "(" + NHDataIndex + ")]");

                throw new Exception("No work can be used for benchmarking");
            }

            _benchmarkTimer.Reset();
            _benchmarkTimer.Start();
            // call base, read only outpus
            //BenchmarkHandle.BeginOutputReadLine();
        }
示例#2
0
 // killing proccesses can take time
 virtual public void EndBenchmarkProcces()
 {
     if (BenchmarkHandle != null && BenchmarkProcessStatus != BenchmarkProcessStatus.Killing && BenchmarkProcessStatus != BenchmarkProcessStatus.DoneKilling)
     {
         BenchmarkProcessStatus = BenchmarkProcessStatus.Killing;
         try {
             Helpers.ConsolePrint("BENCHMARK", String.Format("Trying to kill benchmark process {0} algorithm {1}", BenchmarkProcessPath, BenchmarkAlgorithm.GetName()));
             BenchmarkHandle.Kill();
             BenchmarkHandle.Close();
         } catch { }
         finally {
             BenchmarkProcessStatus = BenchmarkProcessStatus.DoneKilling;
             Helpers.ConsolePrint("BENCHMARK", String.Format("Benchmark process {0} algorithm {1} KILLED", BenchmarkProcessPath, BenchmarkAlgorithm.GetName()));
             //BenchmarkHandle = null;
         }
     }
 }