Jump to content

Question about Timers


Recommended Posts

Hi.

I was wondering if there is some other option than that TimerInit, because it takes 100% of CPU :P

I have a script which do tasks on the time u entered E.g. one task for 3 hours and 5 min and other for 5 hours and 13 min.

I make code like this:

$Timer = _Timer_Init()

While 1
    Select
    Case _Timer_Diff($Timer) >= $Spi1
        $Spi1 = 9999999999999999999999999
        Nadgradi()
    Case _Timer_Diff($Timer) >= $Spi2
        $Spi2 = 9999999999999999999999999
        Nadgradi()
    EndSelect
WEnd

$Spi1 and $Spi2 are declared before this.

So is there some other option how to do that?

Link to comment
Share on other sites

$Timer = _Timer_Init()

While 1
    Select
    Case _Timer_Diff($Timer) >= $Spi1
        $Spi1 = 9999999999999999999999999
        Nadgradi()
    Case _Timer_Diff($Timer) >= $Spi2
        $Spi2 = 9999999999999999999999999
        Nadgradi()
    EndSelect
    sleep(5)
WEnd

increase the sleep duration from 5 if you still get problems.

Edited by Marlo
Click here for the best AutoIt help possible.Currently Working on: Autoit RAT
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...