Partial Class timer_Default
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If TimeOfDay >= #11 :59:55 PM# Then
MsgBox("The current Time Is within 5 seconds of midnight" & _
vbCrLf & "The Timer returns To 0.0 at midnight")
Return
EndIf
Dim start, finish, totalTime AsDouble
If (MsgBox("Press Yes To pause For 5 seconds", MsgBoxStyle.YesNo)) _
= MsgBoxResult.Yes Then
start = Microsoft.VisualBasic.DateAndTime.Timer
Response.Redirect("giris.aspx")
' Set End Time For 5-second duration.
finish = start + 5.0
DoWhile Microsoft.VisualBasic.DateAndTime.Timer < finish
' Do other processing While waiting For 5 seconds To elapse.
Loop
totalTime = Microsoft.VisualBasic.DateAndTime.Timer - start
MsgBox("Paused For " & totalTime & " seconds")
Response.Redirect("Timer.aspx")
EndIf

EndSub
EndClass