當前位置: 首頁>>代碼示例>>C#>>正文


C# MiniProfiler.GetRoundedMilliseconds方法代碼示例

本文整理匯總了C#中StackExchange.Profiling.MiniProfiler.GetRoundedMilliseconds方法的典型用法代碼示例。如果您正苦於以下問題:C# MiniProfiler.GetRoundedMilliseconds方法的具體用法?C# MiniProfiler.GetRoundedMilliseconds怎麽用?C# MiniProfiler.GetRoundedMilliseconds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在StackExchange.Profiling.MiniProfiler的用法示例。


在下文中一共展示了MiniProfiler.GetRoundedMilliseconds方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CustomTiming

        /// <summary>
        /// Returns a new CustomTiming, also initializing its <see cref="Id"/> and, optionally, its <see cref="StackTraceSnippet"/>.
        /// </summary>
        public CustomTiming(MiniProfiler profiler, string commandString)
        {
            _profiler = profiler;
            _startTicks = profiler.ElapsedTicks;
            CommandString = commandString;

            Id = Guid.NewGuid();
            StartMilliseconds = profiler.GetRoundedMilliseconds(profiler.ElapsedTicks);

            if (!MiniProfiler.Settings.ExcludeStackTraceSnippetFromCustomTimings)
            {
                StackTraceSnippet = Helpers.StackTraceSnippet.Get();
            }
        }
開發者ID:haroonxml,項目名稱:dotnet,代碼行數:17,代碼來源:CustomTiming.cs

示例2: Timing

        /// <summary>
        /// Creates a new Timing named 'name' in the 'profiler's session, with 'parent' as this Timing's immediate ancestor.
        /// </summary>
        public Timing(MiniProfiler profiler, Timing parent, string name)
        {
            this.Id = Guid.NewGuid();
            Profiler = profiler;
            Profiler.Head = this;

            if (parent != null) // root will have no parent
            {
                parent.AddChild(this);
            }

            Name = name;
            _startTicks = profiler.ElapsedTicks;
            StartMilliseconds = profiler.GetRoundedMilliseconds(_startTicks);
        }
開發者ID:appacitive,項目名稱:Profiling,代碼行數:18,代碼來源:Timing.cs

示例3: SqlTiming

        /// <summary>
        /// Initialises a new instance of the <see cref="SqlTiming"/> class. 
        /// Creates a new <c>SqlTiming</c> to profile 'command'.
        /// </summary>
        /// <param name="command">The command.</param>
        /// <param name="type">The type.</param>
        /// <param name="profiler">The profiler.</param>
        public SqlTiming(IDbCommand command, ExecuteType type, MiniProfiler profiler)
        {
            Id = Guid.NewGuid();

            CommandString = AddSpacesToParameters(command.CommandText);
            Parameters = GetCommandParameters(command);
            ExecuteType = type;

            if (!MiniProfiler.Settings.ExcludeStackTraceSnippetFromSqlTimings)
                StackTraceSnippet = Helpers.StackTraceSnippet.Get();

            _profiler = profiler;
            if (_profiler != null)
            {
                _profiler.AddSqlTiming(this);
                _startTicks = _profiler.ElapsedTicks;
                StartMilliseconds = _profiler.GetRoundedMilliseconds(_startTicks);
            }
        }
開發者ID:NGPVAN,項目名稱:MiniProfiler,代碼行數:26,代碼來源:SqlTiming.cs

示例4: Timing

        /// <summary>
        /// Creates a new Timing named 'name' in the 'profiler's session, with 'parent' as this Timing's immediate ancestor.
        /// </summary>
        public Timing(MiniProfiler profiler, Timing parent, string name, decimal? minSaveMs = null, bool? includeChildrenWithMinSave = false)
        {
            Id = Guid.NewGuid();
            Profiler = profiler;
            Profiler.Head = this;

            if (parent != null)
            {
                // root will have no parent
                parent.AddChild(this);
            }

            Name = name;

            _startTicks = profiler.ElapsedTicks;
            _minSaveMs = minSaveMs;
            _includeChildrenWithMinSave = includeChildrenWithMinSave == true;
            StartMilliseconds = profiler.GetRoundedMilliseconds(_startTicks);
        }
開發者ID:jchenga,項目名稱:dotnet,代碼行數:22,代碼來源:Timing.cs


注:本文中的StackExchange.Profiling.MiniProfiler.GetRoundedMilliseconds方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。