File tree Expand file tree Collapse file tree 3 files changed +43
-0
lines changed
src/System.Private.CoreLib/shared
Interop/Unix/System.Native Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Licensed to the .NET Foundation under one or more agreements.
2
+ // The .NET Foundation licenses this file to you under the MIT license.
3
+ // See the LICENSE file in the project root for more information.
4
+
5
+ using System ;
6
+ using System . Runtime . CompilerServices ;
7
+ using System . Runtime . InteropServices ;
8
+
9
+ internal static partial class Interop
10
+ {
11
+ internal unsafe partial class Sys
12
+ {
13
+ [ StructLayout ( LayoutKind . Sequential ) ]
14
+ internal struct ProcessCpuInformation
15
+ {
16
+ ulong lastRecordedCurrentTime ;
17
+ ulong lastRecordedKernelTime ;
18
+ ulong lastRecordedUserTime ;
19
+ }
20
+
21
+ [ DllImport ( Libraries . SystemNative , EntryPoint = "SystemNative_GetCpuUtilization" ) ]
22
+ internal static extern unsafe int GetCpuUtilization ( ref ProcessCpuInformation previousCpuInfo ) ;
23
+ }
24
+ }
Original file line number Diff line number Diff line change
1
+ // Licensed to the .NET Foundation under one or more agreements.
2
+ // The .NET Foundation licenses this file to you under the MIT license.
3
+ // See the LICENSE file in the project root for more information.
4
+
5
+ using System ;
6
+ using System . Runtime . CompilerServices ;
7
+ using System . Runtime . InteropServices ;
8
+
9
+ internal static partial class Interop
10
+ {
11
+ internal unsafe partial class Sys
12
+ {
13
+ [ DllImport ( Interop . Libraries . SystemNative , EntryPoint = "SystemNative_GetSystemTimeAsTicks" ) ]
14
+ internal static extern long GetSystemTimeAsTicks ( ) ;
15
+ }
16
+ }
Original file line number Diff line number Diff line change 1107
1107
<Compile Include =" $(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.FLock.cs" />
1108
1108
<Compile Include =" $(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.FSync.cs" />
1109
1109
<Compile Include =" $(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.FTruncate.cs" />
1110
+ <Compile Include =" $(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.GetCpuUtilization.cs" Condition =" '$(FeaturePortableThreadPool)' == 'true'" />
1110
1111
<Compile Include =" $(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.GetCwd.cs" />
1111
1112
<Compile Include =" $(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.GetEUid.cs" />
1112
1113
<Compile Include =" $(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.GetHostName.cs" />
1113
1114
<Compile Include =" $(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.GetPwUid.cs" />
1114
1115
<Compile Include =" $(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.GetRandomBytes.cs" />
1116
+ <Compile Include =" $(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.GetSystemTimeAsTicks.cs" />
1117
+ <Compile Include =" $(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.GetTimestamp.cs" Condition =" '$(FeaturePortableThreadPool)' == 'true'" />
1115
1118
<Compile Include =" $(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.GetUnixName.cs" />
1116
1119
<Compile Include =" $(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.GetUnixRelease.cs" />
1117
1120
<Compile Include =" $(MSBuildThisFileDirectory)Interop\Unix\System.Native\Interop.LockFileRegion.cs" />
You can’t perform that action at this time.
0 commit comments