Write a program to find the program execution time in VB.net

Rajnilari2015
Posted by Rajnilari2015 under VB.NET category on | Points: 40 | Views : 202
The below program will do so

Imports System.Diagnostics
Imports System.Linq

Namespace TodayTask
Class Program
Private Shared Sub Main(args As String())
Dim stopWatch = New Stopwatch()

'start measuring the initial time of the program
stopWatch.Start()

'do some heavy work
Enumerable.Range(1, 200000).ToList().ForEach(Function(i) Console.WriteLine(i))

'finally stop the watch
stopWatch.[Stop]()

'measure the total executuion time
Console.WriteLine(stopWatch.ElapsedTicks)
Console.ReadLine()
End Sub
End Class
End Namespace

Comments or Responses

Login to post response