Example #1
0
        /// <summary>
        /// Gets the <see cref="ProfilerData"/> with the given name for the current thread.
        /// </summary>
        /// <param name="name">The name of the profiler data.</param>
        /// <returns>
        /// The <see cref="ProfilerData"/> with the given name for the current thread.
        /// </returns>
        public static ProfilerData Get(string name)
        {
            var collection = Get();

            ProfilerData data;

            if (!collection.TryGet(name, out data))
            {
                // Not existing? --> Create a new instance.
                data = new ProfilerData(name);
                collection.Add(data);
            }

            return(data);
        }
Example #2
0
        /// <summary>
        /// Gets the <see cref="ProfilerData"/> with the given name for the current thread.
        /// </summary>
        /// <param name="name">The name of the profiler data.</param>
        /// <returns>
        /// The <see cref="ProfilerData"/> with the given name for the current thread.
        /// </returns>
        public static ProfilerData Get(string name)
        {
            var collection = Get();

              ProfilerData data;
              if (!collection.TryGet(name, out data))
              {
            // Not existing? --> Create a new instance.
            data = new ProfilerData(name);
            collection.Add(data);
              }

              return data;
        }