Results 1 to 8 of 8

Thread: GURU : Hight CPU usage

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    208

    Exclamation

    My program take 40 % of the CPU usage ( PIII 500 )
    I want to put an option in the program:

    Maximum CPU usage: X %

    is it possible ??

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    208
    please..
    if it's not possible, just confirm !

  3. #3
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    You can't, sorry.

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Maybe, maybe if you check the CPU usage regulary and then slow down the usage if it's over a specified rate
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    I think it's very hard to make, but it's possible. Your program must have some sort of loop that does the main thing the program needs to do. On first run, execute the loop for exactly 1 second and see how many times it passsed the loop. Now you can put a sleep command in your program for sometime that you must calculate on the first run.
    Sorry if I explained it bad, my English is not very good.
    Oetje
    [email protected]
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

  6. #6
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    Any loops or other coding that you do in VB will use CPU, no matter what you do.

    Specially if you do any kind of database development.

  7. #7
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Sleep API, will that use CPU? just curious, i don't have vb on this comp so i can't test...

    It that's not the case then maybe use SetTimer to call an event for a small interval and execute a small amount of code, would be best with a loop that exits when gettickcount reaches a value each time
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    208
    Also thank'x anyway ..
    I found another solution .
    jsut réduce the code and if the long one is really neacesairy ,take it.. else do the sort one..
    double size but work good..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width