Is There any function to sleep one or two second?

Ricky D

Well-Known Member
Licensed User
Longtime User
Using the timer seems the only way

pseudo code

Init Timer

Do something

Enable Timer
.
.
.
Timer Tick - continue doing stuff after the pause.

It would be nice to be able to pause it at the line then after the pause continue. Using the timer breaks up the code.

regards, Rick
 
Upvote 0

Ricky D

Well-Known Member
Licensed User
Longtime User
Thanks Erel.

I've tested that and it works perfect.

B4X:
Dim starttime, endtime As Long
   Msgbox("Start waiting", "")
   starttime = DateTime.Now
   u.WaitFor(2000) '2 seconds
   endtime = DateTime.Now
   Msgbox(((endtime-starttime)/1000) & " seconds", "")

There is a 2 second delay before the 2nd msgbox pops up and I can't click any of my other views on the screen.

regards, Ricky
 
Last edited:
Upvote 0
Top