Sign in to follow this  
Followers 0
ericnail

Sleep Function

6 posts in this topic

I just found out that when you use:

Sleep(1)

This results in sleep defaulting to 10ms. Is there a way around this??

Is there a way to sleep for only 1ms? Like maybe something like this:

$Timer = TimerInit()
Do 
    $a = TimerDiff($Timer)
Until $a = 1

Anyone have any ideas/knowledge on this?

Thanks,

Eric

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Maybe this helps? Time to Thousandths of a second<br><br>Here's another thread that may help..

Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

Maybe this helps? Time to Thousandths of a second<br><br>Here's another thread that may help..

Awesome! That works.

For what it's worth, since I don't need micro seconds, i found that this actually worked:

SleepLocal(1)

Func SleepLocal($time)
    $a = TimerInit()
    Do 
        $b = TimerDiff($a)
    Until $b >= $time
    Return
EndFunc

But thanks a ton! I am saving that microsecond thing it could be super useful!

Share this post


Link to post
Share on other sites

Why are you wanting to sleep for 1 millisecond anyway?

Share this post


Link to post
Share on other sites

But thanks a ton! I am saving that microsecond thing it could be super useful!

Hey glad to help. Good luck!


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0