internal static void StartTimer(int frameIndex = InjectedDepthByTimer)
        {
            string profileAddress = LiteProfiler.GetProfileAddress(frameIndex);

            if (!string.IsNullOrWhiteSpace(profileAddress))
            {
                if (!LiteProfiler.Diary.ContainsKey(profileAddress))
                {
                    LiteProfiler.Diary.Add(profileAddress, new LiteProfilerLog());
                }

                LiteProfiler.Diary[profileAddress].StopperStartTimes.Push(Stopper.ElapsedMilliseconds);
            }
        }
        /// <summary>
        /// Create a "checkpoint" in code: designed to fit in a log file
        /// </summary>
        /// <param name="comment">Additional specific info to be recorded</param>
        /// <returns>A quote showing exact time and age since beginning of measurement</returns>
        public static LiteProfilerQuote GetQuote(string comment)
        {
            string profileAddress = LiteProfiler.GetProfileAddress(InjectedDepthByTimer);

            if (!string.IsNullOrWhiteSpace(profileAddress))
            {
                return(new LiteProfilerQuote()
                {
                    Comment = comment
                });
            }

            return(new LiteProfilerQuote()
            {
                Address = profileAddress,
                Age = (Stopper != null) ? LiteProfiler.Stopper.ElapsedMilliseconds : 0,
                Comment = comment
            });
        }
Example #3
0
 public LiteProfilerAgent()
 {
     LiteProfiler.StartTimer(LiteProfiler.InjectedDepthByAgent);
 }
Example #4
0
 public void Dispose()
 {
     LiteProfiler.StopTimer(LiteProfiler.InjectedDepthByAgent);
 }