for (int i = 1; i <= count; i++)
{
sw.Reset();
sw.Start();
string guid = Guid.NewGuid().ToString();
sw.Stop();
total += sw.ElapsedMilliseconds;
}
Console.WriteLine(total);
sw.Reset();
for (int i = 1; i <= count; i++)
{
sw.Start();
string guid = Guid.NewGuid().ToString();
sw.Stop();
}
Console.WriteLine(sw.ElapsedMilliseconds);
}</pre></div>
for (int i = 1; i <= count; i++)
{
sw.Reset();
sw.Start();
System.Threading.Thread.Sleep(10);
sw.Stop();
total += sw.ElapsedMilliseconds;
}
Console.WriteLine(total);
sw.Reset();
for (int i = 1; i <= count; i++)
{
sw.Start();
System.Threading.Thread.Sleep(10);
sw.Stop();
}
Console.WriteLine(sw.ElapsedMilliseconds);
}</pre></div>
for (int i = 1; i <= count; i++)
{
sw.Reset();
sw.Start();
System.Threading.Thread.Sleep(1000);
sw.Stop();
total += sw.ElapsedMilliseconds;
}
Console.WriteLine(total);
sw.Reset();
for (int i = 1; i <= count; i++)
{
sw.Start();
System.Threading.Thread.Sleep(1000);
sw.Stop();
}
Console.WriteLine(sw.ElapsedMilliseconds);
}</pre></div>