本文整理汇总了C#中System.Diagnostics.Stopwatch.stop方法的典型用法代码示例。如果您正苦于以下问题:C# System.Diagnostics.Stopwatch.stop方法的具体用法?C# System.Diagnostics.Stopwatch.stop怎么用?C# System.Diagnostics.Stopwatch.stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Diagnostics.Stopwatch
的用法示例。
在下文中一共展示了System.Diagnostics.Stopwatch.stop方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EmailValidation_Performance_Random_EmailAdress
public void EmailValidation_Performance_Random_EmailAdress()
{
var maxIterations = 100000;
var newUser = new NewUser().with_Random_Data();
var sw = new System.Diagnostics.Stopwatch();
for (var index = 0; index < maxIterations; index++)
{
newUser.Email = "".random_Email();
sw.Start();
newUser.valid_Email_Address().assert_Is_True();
sw.stop();
sw.Elapsed.seconds().assert_Size_Is_Smaller_Than(3);
sw.Reset();
}
}
示例2: EmailValidation_Performance_Test
public void EmailValidation_Performance_Test()
{
var maxIterations = 10000;
var newUser = new NewUser().with_Random_Data();
var sw = new System.Diagnostics.Stopwatch();
for (var index = 0; index < maxIterations; index++)
{
//Incrementing email lenght.
newUser.Email = "".add_RandomLetters(50 + index);
sw.Start();
newUser.valid_Email_Address().assert_False();
sw.stop();
sw.Elapsed.seconds().assert_Size_Is_Smaller_Than(3);
sw.Reset();
}
}
示例3: EmailValidation_Performance_Fixed_Strings
public void EmailValidation_Performance_Fixed_Strings()
{
int maxIterations = 100000;
var newUser = new NewUser().with_Random_Data();
var sw = new System.Diagnostics.Stopwatch();
for (var index = 0; index < maxIterations; index++)
{
newUser.Email = "".add_RandomLetters(50);
sw.Start();
bool result = newUser.valid_Email_Address();
sw.stop();
sw.Elapsed.seconds().assert_Size_Is_Smaller_Than(3);
sw.Reset();
}
}