Monday

Add a Delay without using sleep / wait



Lets see a simple code snippet that will add some delay without using the native wait or sleep methods while coding using VBs/QTP/QC

Sub Delay( seconds )
    Dim wshShell
    Set wshShell = CreateObject( "WScript.Shell" )
    wshShell.Run "ping -n " & ( seconds + 1 ) & " 127.0.0.1", 0, True
    Set wshShell = Nothing
End Sub


Happy Coding!

No comments:

Post a Comment