public void Stop()
 {
     _timer.Stop();
     _previousReading = new CPUReading();
     _currentReading  = new CPUReading();
     ResetCPUStates();
     _onTick(_powerScheme.GetMaxCPUState());
 }
        public TemperatureTargetedPowerMode()
        {
            _previousReading  = new CPUReading();
            _currentReading   = new CPUReading();
            _sensorCollection = CPUSensorsFactory.GetCPUZeroSensor();

            _timer          = new Timer();
            _timer.Interval = 500;
            _timer.Tick    += (sender, e) => { DoCycle(); _onTick(_currentReading.ProcessorState); };
        }
Пример #3
0
        static void Main(string[] args)
        {
            TemperatureTargetedPowerMode clockOrchestrator = ParseArgs(args);

            while (true)
            {
                CPUReading reading = clockOrchestrator.DoCycle();
                Console.WriteLine($"Temp: {reading.Temperature}, Change: {reading.TemperatureFluctuationType}, Percentage: {reading.ProcessorState}");
                Thread.Sleep(25);
            }
        }