public static void SetProfiler(IProfilerTest profiler) { lock (_syncObject) { if (profiler == null) { profiler = null;//DefaultProfiler.Instance; } else if (profiler.GetType() != typeof(ProfilerWrapper) && !profiler.GetType().IsSubclassOf(typeof(ProfilerWrapper))) { profiler = new ProfilerWrapper(profiler); } System.Threading.Interlocked.Exchange(ref _profiler, profiler); _isProfilingEnabled = !object.ReferenceEquals(profiler, DefaultProfiler.Instance); } }
public ProfilerWrapper(IProfilerTest wrp) { _wrp = wrp; }