Skip to content

Instantly share code, notes, and snippets.

@adamjez
Last active May 6, 2017 09:03
Show Gist options
  • Select an option

  • Save adamjez/521581903cac93653ab568fc4d7feda0 to your computer and use it in GitHub Desktop.

Select an option

Save adamjez/521581903cac93653ab568fc4d7feda0 to your computer and use it in GitHub Desktop.
BenchmarkDotNet=v0.10.5, OS=ubuntu 16.04
Processor=Intel Xeon CPU E5-2660 0 2.20GHz, ProcessorCount=2
Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN
dotnet cli version=1.0.3
  [Host]     : .NET Core 4.6.25009.03, 64bit RyuJIT
  DefaultJob : .NET Core 4.6.25009.03, 64bit RyuJIT

Method Mean Error StdDev
ProcessStarting 103.7 ms 1.290 ms 1.486 ms
BenchmarkDotNet=v0.10.5, OS=ubuntu 16.04
Processor=Intel Xeon CPU E5-2660 0 2.20GHz, ProcessorCount=2
Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN
dotnet cli version=2.0.0-preview2-005905
  [Host]     : .NET Core 4.6.25226.02, 64bit RyuJIT
  DefaultJob : .NET Core 4.6.25226.02, 64bit RyuJIT

Method Mean Error StdDev Median
ProcessStarting 88.75 ms 7.741 ms 22.21 ms 101.9 ms
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
namespace long_running
{
class Program
{
static void Main(string[] args)
{
var summary = BenchmarkRunner.Run<Test>();
Console.Write(summary);
}
}
public class Test
{
[Benchmark]
public void ProcessStarting()
{
Process process;
using(process = Process.Start("/bin/echo"))
{
process.WaitForExit();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment