Skip to content

Instantly share code, notes, and snippets.

@Zoxive
Created June 3, 2016 14:41
Show Gist options
  • Save Zoxive/3cc3ad933f814e3a364fff7c3ac17274 to your computer and use it in GitHub Desktop.
Save Zoxive/3cc3ad933f814e3a364fff7c3ac17274 to your computer and use it in GitHub Desktop.
BenchmarkDotNet getting variables inside a test
public class CreateQuotes
{
public CreateQuotes()
{
// TODO get access to string[] args from Program.Main(args)
var options = // Read From a Singleton? or from App.config?
}
[Benchmark]
public void NonConfig()
{
// benchmark stuff
}
}
public class Program
{
private static void Main(string[] args)
{
// Set args on a static singleton (doesnt work)
// Save args to app.config?
var cfg = ManualConfig.Create(DefaultConfig.Instance)
.With(Job.Dry);
BenchmarkRunner.Run<CreateQuotes>(cfg);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment