Skip to content

MichaelJohnSteiner.com

C# Source Code

Tag: Processor

CpuTotalPc.cs

Cpu Load

using System.Diagnostics;
public static class CpuTotalPc
{
    private static PerformanceCounter _CPUsage;
    public static double CPULoad
    {
        get
        {
            if (_CPUsage == null)
                try
                {
                    _CPUsage = new PerformanceCounter("Processor", "% Processor Time", "_Total");
                }
                catch
                {
                    return 0;
                }
            return _CPUsage.NextValue();
        }
    }
}
Author mjsPosted on June 13, 2020Categories C# Source CodeTags CPU, Load, PerformanceCounter, ProcessorLeave a comment on CpuTotalPc.cs

Recent Posts

  • BoyerMooreString.cs
  • BoyerMooreGeneric.cs
  • CcArray.cs
  • CcDictionary.cs
  • CcHashSet.cs
  • CcCollection.cs
  • Windows 11 Enable New Boot Animation
  • Windows 11 Use Windows 10 File Explorer
  • Windows 11 Move Taskbar to Top
  • Windows 11 Change Taskbar Size
  • Windows 11 Tray Icons Fix
  • SegmentedArray.cs
  • SegmentedHashSet.cs
  • JaggedArray.cs
  • BucketHashSet3.cs
  • DigitsArray.cs
  • BigIntX.cs
  • FNV1aX.cs
  • Fnv1a64Fast.cs
  • FNV1a32Fast.cs
  • RandomBigInt.cs
  • ObjectAssociativeArray.cs
  • ObjectDictionary.cs
  • SizeHelper32.cs
  • ObjectBase.cs
  • AcDictionary.cs
  • SessionId.cs
  • EntropyEx.cs
  • MemoryStreamReader.cs
  • MemoryStreamWriter.cs
  • RawMemoryStreamWriter.cs
  • RandomX.cs
  • FNV1a128b.cs
  • GetBytesClass.cs
  • ObjectIndexer.cs
  • Sha16512.cs
  • MonitorActionFuncWrapper.cs
  • ReaderWriterLockSlimActionFuncWrapper.cs
  • MapComparer.cs
  • Mapping256BitTo32BitHash.cs
  • BigHashsetSa.cs
  • BigHashSet.cs
  • BigComparer.cs
  • BigArray.cs
  • SecureStringHelper.cs
  • BigIntegerHelper.cs
  • xIntX.cs
  • BigRational.cs
  • (Obsolete) IntX.cs
  • (Obsolete) UIntX.cs
  • LinqHelper.cs
  • BigIntegerPrime.cs
  • BigDecimal.cs
  • NativeWin32.cs
  • SetupDi.cs
  • Ellipse.cs
  • CustomToolTip.cs
  • Random64csp.cs
  • (Obsolete) FixedUIntXInt.cs
  • LongLong.cs
  • (Obsolete) Int512.cs
  • (Obsolete) Int256.cs
  • ConcurrencyCheck.cs
  • ZOB64.cs
  • KSM128.cs
  • CRC64cs
  • MSet15.cs
  • ComparerEx.cs
  • SizeHelper.cs
  • MeasureSize.cs
  • MiniSet.cs
  • MiniArray.cs
  • (Obsolete) Int128.cs
  • Mapping64BitToHash32Bit.cs
  • FNV1a64.cs
  • Mapping160BitTo64BitHash.cs
  • ArrayComparer.cs
  • TinyDictionary.cs
  • TinySet.cs
  • SizeHelper.cs
  • MiscByte.cs
  • ArrayMixer.cs
  • RngJitterSource.cs
  • EntropyGeneric.cs
  • EntropySource.cs
  • SHA3ModInt.cs
  • Random64d.cs
  • ByteArraySegment.cs
  • Reporter.cs
  • StringHelper.cs
  • ArrayHelper.cs
  • Converters.cs
  • PasswordStretch.cs
  • CpuTotalPc.cs
  • FixedIntXPrimality.cs
  • TextBinaryFileId.cs
  • Writer.cs
  • Reader.cs
  • KeccakSpongeManaged.cs
  • BMPartialPatternSearch.cs
MichaelJohnSteiner.com Proudly powered by WordPress