VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Pausing an application that doesn't burden the CPU

by Frank Donckers (9 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 11th June 2006
Date Added: Mon 8th February 2021
Rating: (1 Votes)

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



    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


Download this snippet    Add to My Saved Code

Pausing an application that doesn't burden the CPU Comments

No comments have been posted about Pausing an application that doesn't burden the CPU. Why not be the first to post a comment about Pausing an application that doesn't burden the CPU.

Post your comment

Subject:
Message:
0/1000 characters