static Config() { DefaultSettings = new Settings() { StopwatchType = typeof (DefaultStopwatch), TargetType = typeof (ConsoleTarget) }; }
public MicroProfiler(string name = null, IStopwatch stopwatch = null, ITarget target = null, Settings settings = null) { Name = name; if (settings == null) settings = Config.DefaultSettings; _stopwatch = stopwatch ?? settings.StopwatchInstance ?? Activator.CreateInstance(settings.StopwatchType) as IStopwatch; _target = target ?? settings.TargetInstance ?? Activator.CreateInstance(settings.TargetType) as ITarget; Start(); }