The Timer type in the VB.NET language provides a way for you to call a subroutine every several seconds. You must construct the Timer instance and then add handlers to it; using the ElapsedEventHandler, you can specify a subroutine to perform the maintenance or updating code.
This VB article covers the Timer type from the System.Timers namespace. Timers monitor processes.

First, this class is VB.NET Class that has some Shared fields: it has a Timer instance and also a List instance. In the Start subroutine, we construct the Timer, specifying its interval as 3000 milliseconds (3 seconds); next we call the AddHandler operator to assign the Handler subroutine as the code that is executed every three seconds. Finally, we set the Enabled property to True to start the Timer.
Class that uses Timer type [VB.NET]
Imports Microsoft.VisualBasic
Imports System.Timers
Public Class TimerTest
Shared _timer As Timer
Shared _list As List(Of String) = New List(Of String)
''' <summary>
''' Start the timer.
''' </summary>
Shared Sub Start()
_timer = New Timer(3000)
AddHandler _timer.Elapsed, New ElapsedEventHandler(AddressOf Handler)
_timer.Enabled = True
End Sub
''' <summary>
''' Get timer output.
''' </summary>
Shared Function GetOutput() As String
Return String.Join("<br>", _list)
End Function
''' <summary>
''' Timer event handler.
''' </summary>
Shared Sub Handler(ByVal sender As Object, ByVal e As ElapsedEventArgs)
_list.Add(DateTime.Now.ToString())
End Sub
End ClassUsing this code. In our example, we will use this code in an ASP.NET website. To start the Timer, the Start() subroutine shown above will have to be called during website startup. The GetOutput() Function will show the DateTimes that were collected by the Timer.

Here, we demonstrate how in the VB.NET language you can use the Timer class shown above in your ASP.NET website. First, you should add the Global.asax file; this provides a handy way to call code at your website startup. In the Application_Start handler, we simply call the TimerTest.Start subroutine that was declared in the class. Then, in the Application_BeginRequest subroutine, we simply output the text of the List collected by the Timer.
Example Global.asax [VB.NET]
<%@ Application Language="VB" %>
<script runat="server">
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
TimerTest.Start()
End Sub
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
Response.Write(TimerTest.GetOutput())
End Sub
</script>Using the website. When you first visit the website, the Timer is started. From this point on, the Timer will add a String to the List every three seconds. Refresh the page occasionally and you will see the Timer is executing its Handler code. The result is the screenshot at the top of the article.

Tip. If you are starting with an empty ASP.NET website, you will want to add a Default.aspx page as well as this will trigger the runtime to call the Application_Start and Application_BeginRequest handlers. This tip isn't really relevant to the Timer type itself.

We saw how you can use VB.NET to add a Timer to your ASP.NET website. The Timer is an excellent way to maintain the data or caches in your website. Also, because it is separate from request handling, it will not cause slowdowns for visitors on your website. As an aside, the Timer can also be used in Windows Forms or other kinds of programs.
VB.NET Tutorials