示例#1
0
        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);
            }
        }
示例#2
0
 public ProfilerWrapper(IProfilerTest wrp)
 {
     _wrp = wrp;
 }