Jump to content
Sign in to follow this  
MikelSevrel

Excessive CPU Usage?

Recommended Posts

MikelSevrel

Hello, the program I crated, when it runs Task Manager says it's using lots of CPU power, but it's not slowing down or anything. I was just curious as to the reason, and if thre was any way to "fix" it. Here's the part that actually runs:

#include <Date.au3>
#include <File.au3>
#include <Array.au3>
#include <convertdays.au3>

Dim $section
While 1
$ininames = IniReadSectionNames ( @WorkingDir & "\src\schedule.ini" )
for $i = 1 to $ininames[0]
    $section = IniReadSection (@WorkingDir & "\src\schedule.ini", $ininames[$i])
    $rightnow = @HOUR & ":" & @MIN & ":" & @SEC
    If StringInStr($section[2][1] & ":00", $rightnow) Then
        IF StringInStr($section[3][1], $today) Then
            IF StringInStr($section[4][1], "Only For the Next Week") Then
                RunWait($section[1][1])
                $dates = IniRead (@WorkingDir & "\src\schedule.ini", $ininames[$i], "Dates", "" )
                $dates = StringSplit($dates, ",")
                $ubound = UBound($dates)
                If $ubound <= 1 Then
                    IniDelete (@WorkingDir & "\src\schedule.ini", $ininames[$i])
                Else
                StringRegExpReplace ($dates, $today, "")
                EndIf
            ElseIf StringInStr($section[4][1], "Weekly") Then
                RunWait($section[1][1])
            EndIf
        EndIf
    EndIf
Next
WEnd

Coming soon....

Share this post


Link to post
Share on other sites
Valuater

just slow it down a little with a sleep

EndIf
Sleep(1)
Next
WEnd

8)


NEWHeader1.png

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.