当前位置: 首页>>代码示例>>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;未经允许,请勿转载。