Pause execution for few seconds in VB6

Timers control is familiar control in Visual Basic 6.0 which enable programmer to execute code within a specified intervals. But what you do when y want to keep computer delaying execution for few minutes/seconds? Here is the solution.
With the Timer object your can do this trick. Create a Sub to perform the delay operations.

Sub Pause(interval)
Current = Timer
Do While Timer – Current < Val(interval)
End Sub 
Now call the Pause() with delay time as seconds
call Pause (1)  ‘will delay execution of statements for few seconds

Published by


A developer,teacher and a blogger obsessed with Python,Dart and open source world from India

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.