示例#1
0
        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);
            }
        }
示例#2
0
        /// <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
            });
        }
示例#3
0
 public LiteProfilerAgent()
 {
     LiteProfiler.StartTimer(LiteProfiler.InjectedDepthByAgent);
 }
示例#4
0
 public void Dispose()
 {
     LiteProfiler.StopTimer(LiteProfiler.InjectedDepthByAgent);
 }