Esempio n. 1
0
        public void Check()
        {
            if (!_hasStarted)
            {
                throw new InvalidOperationException("CpuMonitor'ing was not started!");
            }

            var curTemps = MonitoringUtils.ReadCpuTemp().ToArray();

            for (var i = 0; i < Math.Min(Math.Min(Min.Length, Max.Length), curTemps.Length); i++)
            {
                var min = Min[i];
                var max = Max[i];
                var cur = curTemps[i];

                if (min.Current > cur.Current)
                {
                    min.Current = cur.Current;
                }
                if (max.Current < cur.Current)
                {
                    max.Current = cur.Current;
                }
            }
        }
Esempio n. 2
0
        public void Start()
        {
            if (_hasStarted)
            {
                throw new InvalidOperationException("CpuMonitor'ing has been already started!");
            }

            _hasStarted = true;

            Min = MonitoringUtils.ReadCpuTemp().ToArray();
            Max = Min.Select(readnings => readnings.Clone()).ToArray();
        }