Jump to content

sleep in minutes?


Ashww
 Share

Recommended Posts

  • Replies 44
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

It's been there for a while. And if I remember correctly it can't be fixed?

According to monoceres every call we do to Sleep() generates multiple internal calls, so it should be possible, right?

Edit: Here is the post I am referring to

Edited by AdmiralAlkex
Link to comment
Share on other sites

According to monoceres every call we do to Sleep() generates multiple internal calls, so it should be possible, right?

Edit: Here is the post I am referring to

Well either way, the time it takes for the interrupt to start and end would add time anyway. Although you won't really notice 1 or 10 milliseconds.
Link to comment
Share on other sites

  • Developers

Did Jos just imply I am a "techie" :P

Either way and no matter whatever we do, it will always end up out of sync.

yep... but between double quotes .....

Seriously: Don't think there is any forced minimum time in AutoIt3, just the time it takes to process the Sleep(xyz) scriptline.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Dim $iInit, $TimeDiff[100]

For $i = 0 To 99
    $iInit = TimerInit()
    For $j = 0 To 273
        Sleep(0)
    Next
    $TimeDiff[$i] = TimerDiff($iInit)
Next

Dim $Avg = 0
For $i = 0 To 99
    ConsoleWrite('Timer Diff: ' & $TimeDiff[$i] & @LF)
    $Avg += $TimeDiff[$i]
Next

ConsoleWrite('Average: ' & $Avg/100 & @LF)

Not accurate but probably statistical results has to do something with it. ~the TimeDiff and TimeInit intervals but it's also machine depended and the minimum amount of time the resolution allows.

Link to comment
Share on other sites

Since always.

A better alternative would be to call the native sleep api directly.

Script that does that.

Yeah you really hit the jackpot with that one, without _HighPrecisionSleep() I would never have been able to get acceptable speeds with Platformerious (a so far unrealeased platform-game)

yep... but between double quotes .....

Seriously: Don't think there is any forced minimum time in AutoIt3, just the time it takes to process the Sleep(xyz) scriptline.

Jos

Well I learned it from this forum, it was one of the devs or mods that said it, I will try to find it. Besides shouldn't then Sleep(0) also be around 10ms? Edited by AdmiralAlkex
Link to comment
Share on other sites

  • Developers

Yeah you really hit the jackpot with that one, without _HighPrecisionSleep() I would never have been able to get acceptable speeds with Platformerious (a so far unrealeased platform-game)

Well I learned it from this forum, it was one of the devs or mods that said it, I will try to find it. Besides shouldn't then Sleep(0) also be around 10ms?

Ok, let me check the details.

I know there is an implicit sleep(10) for GuiGetMsg(), but have to check to code to see if Sleep has a minimum of 10.

EDIT: Sleep(0) is treated differently.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...