using System;
using System.Diagnostics;
using System.Threading;
class SleepMethod
{
static void Main()
{
var stopwatch = Stopwatch.StartNew();
Thread.Sleep(4000);
stopwatch.Stop();
Console.WriteLine("Elapsed Milliseconds : {0}", stopwatch.ElapsedMilliseconds);
Console.WriteLine("Elapsed Ticks : {0}", stopwatch.ElapsedTicks);
Console.WriteLine("Present Date and Time : {0}", DateTime.Now.ToLongTimeString());
Console.ReadLine();
}
}
----------------
OUTPUT:-
Elapsed Milliseconds : 3999
Elapsed Ticks : 12468015
Present Date and Time : 9:27:22 AM
-------------------------------------------
using System.Diagnostics;
using System.Threading;
class SleepMethod
{
static void Main()
{
var stopwatch = Stopwatch.StartNew();
Thread.Sleep(4000);
stopwatch.Stop();
Console.WriteLine("Elapsed Milliseconds : {0}", stopwatch.ElapsedMilliseconds);
Console.WriteLine("Elapsed Ticks : {0}", stopwatch.ElapsedTicks);
Console.WriteLine("Present Date and Time : {0}", DateTime.Now.ToLongTimeString());
Console.ReadLine();
}
}
----------------
OUTPUT:-
Elapsed Milliseconds : 3999
Elapsed Ticks : 12468015
Present Date and Time : 9:27:22 AM
-------------------------------------------
No comments:
Post a Comment