Skip to content

Commit

Permalink
Add a demo C# program
Browse files Browse the repository at this point in the history
  • Loading branch information
cgaebel committed Mar 31, 2022
1 parent 8b5aa20 commit a306b37
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions demo/csharp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bin/
obj/
12 changes: 12 additions & 0 deletions demo/csharp/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.IO;

FileStream r = new FileStream("/dev/zero", FileMode.Open, FileAccess.Read);
FileStream w = new FileStream("/dev/null", FileMode.Open, FileAccess.Write);
int len = 4096;
byte[] buf = new byte[len];

for(;;) {
r.Read(buf, 0, len);
w.Write(buf, 0, len);
}
10 changes: 10 additions & 0 deletions demo/csharp/csharp.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
2 changes: 2 additions & 0 deletions demo/csharp/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
COMPlus_PerfMapEnabled=1 dotnet run

0 comments on commit a306b37

Please sign in to comment.