A simple timer class written in VB .Net
Imports System.Timers
Public Class TestTimer
Shared _timer As New Timer()
Dim _timerInterval As Integer = 10000 ‘in milliseccondsPublic Sub New()
Initialize()
End SubPublic Sub Initialize()
AddHandler _timer.Elapsed, AddressOf _timer_Elapsed
_timer.Interval = _timerInterval
End SubPublic Sub _timer_Elapsed(ByVal sender As Object, ByVal e As ElapsedEventArgs)
‘As long as timer is ‘enabled’ this function will be triggered every time interval set (in this case every 10 seconds)
‘do something here
End SubPublic Sub start()
_timer.Enabled = True
End SubPublic Sub stopTimer()
_timer.Enabled = False
End SubEnd Class
Tags: vb .net sample code
.Net asp .net tutorial asp .net tutorial c# sample code CSS sample script database guide java sample code javascript sample code mssql sample script string reverse in C# t-sql telerik sample code user-defined function vb .net sample code visual studio tutorial
WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.
RSS feed for comments on this post · TrackBack URI
Leave a reply