public IBenchmarkStrategy <TContext> Create(
            TContext context,
            CandidateRunnerWithContextArgs <TContext> args)
        {
            if (args.FixedNumberOfRuns.HasValue)
            {
                return(new FixedNumberOfRunsBenchmarkStrategy <TContext>(context, args));
            }

            if (args.DurationPerCandidate.HasValue)
            {
                return(new FixedDurationPerCandidateBenchmarkStrategy <TContext>(context, args));
            }

            return(new FixedDurationPerContextBenchmarkStrategy <TContext>(context, args));
        }
Example #2
0
 public CandidateRunner(CandidateRunnerWithContextArgs <TContext> args)
 {
     this.args = args;
 }
 public FixedNumberOfRunsBenchmarkStrategy(TContext context, CandidateRunnerWithContextArgs <TContext> args)
 {
     this.context = context;
     this.args    = args;
 }
 public FixedDurationPerCandidateBenchmarkStrategy(TContext context, CandidateRunnerWithContextArgs <TContext> args)
 {
     this.context = context;
     this.args    = args;
 }