Jump to content

measure cpu usage


Recommended Posts

i want to play a wave file when the cpu useage of my quad core drops below x.

How do i detect the cpu useage?

Although i personally have never used them, i'm sure they work pretty well, considering the comments below the post...but these were in the Example Scripts part of the forum..

Measure how much your script is using:

http://www.autoitscript.com/forum/index.php?showtopic=98592

Measure how much a specific process is using:

http://www.autoitscript.com/forum/index.php?showtopic=55877

With a little time spent it should not be too hard to incorporate a method that looks at all the processes instead of just one.

Good luck!

Instant Lockerz Invite - www.instantlockerzinvite.co.uk
Link to comment
Share on other sites

my crude code is below if anyone wants it.

it sounds ding when the cpu drops below 100

Run("Taskmgr.exe")
$counter = 0
While 1
    $op = StatusbarGetText("Windows Task Manager", "", 2)
    If $op <> "CPU Usage: 100%" Then


        $counter = $counter + 1
        If $counter > 10 Then
            SoundPlay("c:\windows\media\ding.wav")
            $counter = 0
        EndIf
    
    EndIf

If $op = "CPU Usage: 100%" Then $counter = 0
TrayTip($op,$counter,2)

    ;ConsoleWrite($op & " " & $counter & @CRLF)
    Sleep(1000)
WEnd
Edited by trademaid
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...