Pausing an application that doesn't burden the CPU
Pausing an application that doesn't burden the CPU
API Declarations
Private Declare Sub sleep Lib "kernel32" _
Alias "Sleep" (ByVal dwMilliseconds As Long)
Rate Pausing an application that doesn't burden the CPU
(1(1 Vote))
Dim strMSG As String
Dim intSeconds As Integer
Again:
strMSG = InputBox("Type the waiting-time in seconds and press 'Enter'", "Test pausing", "10")
intSeconds = Val(strMSG)
If intSeconds = 0 Then End
If intSeconds > 360 Then
strMSG = MsgBox("Maximum = 360 seconds please", vbOKOnly, "Woops")
GoTo Again
End If
strMSG = "Time begin: " & Time
Wait (intSeconds)
strMSG = strMSG & vbCrLf & "Time end : " & Time
strMSG = MsgBox(strMSG, vbOKOnly)
End
End Sub
Public Sub Wait(Seconds As Single)
Dim lMilliSeconds As Long
lMilliSeconds = Seconds * 1000
sleep lMilliSeconds
End Sub
Pausing an application that doesn't burden the CPU Comments
No comments yet — be the first to post one!
Post a Comment