|
-
Oct 9th, 2000, 04:43 PM
#1
Thread Starter
Addicted Member
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 ??
-
Oct 9th, 2000, 08:57 PM
#2
Thread Starter
Addicted Member
please..
if it's not possible, just confirm !
-
Oct 10th, 2000, 10:00 AM
#3
-
Oct 10th, 2000, 10:09 AM
#4
transcendental analytic
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.
-
Oct 10th, 2000, 10:10 AM
#5
Fanatic Member
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.
-
Oct 10th, 2000, 10:20 AM
#6
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.
-
Oct 10th, 2000, 10:55 AM
#7
transcendental analytic
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.
-
Oct 14th, 2000, 11:14 PM
#8
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|