Tools Links Login

A Super Easy Delay Timer

A delay timer so easy, this paragraph is longer. I had to submit this easy code because it is not on this website. Uses no API, and it is very handy!!

Original Author: Patrick K. Bigley

Assumptions

Make a form with a command button ont it. Paste the code into the command button. This sample has a 3 second delay, then you hear a beep.

Code

Private Sub Command1_Click()
Dim Start As Long
Start = Timer
  
  Do While Timer < Start + 3 'a 3 second delay (Change to any numer you want)
   DoEvents  ' Yield to other processes.
  Loop
  
Beep

End Sub

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 115 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.