Files
stgsharp/源代码/BenchMark/Program.cs
T

25 lines
596 B
C#

using BenchmarkDotNet.Running;
using BenchmarkDotNet.Attributes;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BenchmarkDotNet.Jobs;
using Microsoft.Diagnostics.Tracing.Parsers.Clr;
namespace BenchMark
{
internal unsafe class Program
{
static void Main(string[] args)
{
int[] a = new int[10];
IntPtr p = GCHandle.Alloc(a, GCHandleType.Pinned).AddrOfPinnedObject();
Console.WriteLine(*(int*)p);
}
}
}