Exemple #1
0
        /// <summary>
        /// Initializes a <see cref="StepTiming"/>.
        /// </summary>
        /// <param name="profiler">
        ///     The <see cref="IProfiler"/> where
        ///     to add the <see cref="StepTiming"/> to when stops.
        /// </param>
        /// <param name="name">The name of the <see cref="StepTiming"/>.</param>
        public StepTiming(IProfiler profiler, string name)
            : base(profiler
                , "step"
                , GetParentId(profiler)
                , name)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            _profiler = profiler;
            StartMilliseconds = _profiler.DurationMilliseconds;
            Sort = profiler.GetDurationTicks();
            ProfilingSession.ProfilingSessionContainer.CurrentSessionStepId = Id;
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new <see cref="CustomTiming"/>.
 /// </summary>
 /// <param name="profiler">
 ///     The <see cref="IProfiler"/> where
 ///     to add the <see cref="CustomTiming"/> to when stops.
 /// </param>
 /// <param name="type">The type of the <see cref="CustomTiming"/></param>
 /// <param name="name">The name of the <see cref="CustomTiming"/></param>
 public CustomTiming(IProfiler profiler, string type, string name)
     : base(profiler, type, ProfilingSession.ProfilingSessionContainer.CurrentSessionStepId, name)
 {
     StartMilliseconds = profiler.DurationMilliseconds;
     Sort = profiler.GetDurationTicks();
 }