سلام خدمت کاربران وب سایت پروگرم 98 😉 در این مطلب آموزش استفاده از Stopwatch و start و stop و reset در #C را آماده کردم. امیدوارم که این کد برای شما مفید باشد.
خروجی این کد به صورت زیر می باشد:
Parse pattern took 0ms
TryParse pattern took 0ms
TryParse pattern took 0ms
کد استفاده از Stopwatch و start و stop و reset در #C :
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading;
public class MainClass
{
public static void Main()
{
Stopwatch sw = new Stopwatch();
sw.Start();
for (int i = 0; i < 1000; i++)
{
}
sw.Stop();
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading;
public class MainClass
{
public static void Main()
{
Stopwatch sw = new Stopwatch();
sw.Start();
for (int i = 0; i < 1000; i++)
{
}
sw.Stop();