Sign in to follow this  
Followers 0
DoctorSLO

Question about Timers

4 posts in this topic

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?

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

$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

Share this post


Link to post
Share on other sites

Thanks for help, it's OK now :P

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