Jump to content

Excessive CPU Usage?


Recommended Posts

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....

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...