Jump to content
Sign in to follow this  
trademaid

measure cpu usage

Recommended Posts

trademaid

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?

Share this post


Link to post
Share on other sites
furrycow

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

Share this post


Link to post
Share on other sites
trademaid

This will do be, though i prefer not to have task manger present.

In an ideal world would like to know useage of just one process.

The first far more elaborate script will take a bit of work to strip down.

Thank you both for replies.

Share this post


Link to post
Share on other sites
trademaid

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

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  

×