VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Timeout/Pause

Xeek  (2 Submissions)   Miscellaneous   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

You can pause execution of code for the specified duration. Different from "Sleep" api in that it will not lock up the whole program.

Inputs
Duration - Specify the seconds you want to pause execution for

Assumes
GetTickCount(api), like Timer resets at some point. Timer resets at midnight, and returns the seconds since midnight. GetTickCount returns the ticks (milliseconds) since the o/s was started. I remember reading that it resets to 0 after 49.7 days (different o/s may vary [windows]). I don't think it should cause a problem, but it may result in the loop, looping indefinitely until the program is shut down. This is slightly more accurate than timeout/pause routines that use Timer.

API Declarations
Declare Function GetTickCount Lib "kernel32" Alias "GetTickCount" () As Long

Rate Timeout/Pause (2(2 Vote))
Timeout/Pause.bas

Timeout/Pause Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters