本文整理汇总了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();
}
}
示例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);
}
示例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);
}
}
示例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);
}