BoC.Profiling.Profiler.StartContext C# (CSharp) Method

StartContext() public static method

Begins the profiling.
public static StartContext ( string key ) : IDisposable
key string The key.
return IDisposable
        public static IDisposable StartContext(string key, params object[] stringFormatParameters)
        {
            if (!Enabled)
                return new DummyProfiler();

            Enabled = false;//don't profile the profiler
            try
            {
                var profiler = IoC.Resolver.Resolve<Profiler>();
                if (stringFormatParameters != null && stringFormatParameters.Length > 0)
                {
                    key = string.Format(key, stringFormatParameters);
                }
                return new ProfilingContext(key, profiler._performanceProfilers);
            }
            finally
            {
                Enabled = true;
            }
        }