File: src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\RuntimeEventSourceHelper.Unix.cs
Web Access
Project: src\src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj (System.Private.CoreLib)
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
 
namespace System.Diagnostics.Tracing
{
    internal static class RuntimeEventSourceHelper
    {
        private static Interop.Sys.ProcessCpuInformation s_cpuInfo;
 
        internal static double GetCpuUsage() =>
            Interop.Sys.GetCpuUtilization(ref s_cpuInfo) / Environment.ProcessorCount;
    }
}