Jump to content
Sign in to follow this  
ericnail

Sleep Function

Recommended Posts

ericnail

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
ericnail

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
Richard Robertson

Why are you wanting to sleep for 1 millisecond anyway?

Share this post


Link to post
Share on other sites
somdcomputerguy

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.