bogdanc Active Member Licensed User Longtime User Feb 23, 2017 #1 Hi! I'm trying to get a CPU load. for one of the PC that I tried check getting a value -100 instead of real value: 60% etc here is my simple code: Code: Dim CPULoad As AWTRobot Dim cpLoad As Int =NumberFormat ( (CPULoad.SystemCPULoad*100) ,0,2 ) what could cause the issue. Thanks for any help.
Hi! I'm trying to get a CPU load. for one of the PC that I tried check getting a value -100 instead of real value: 60% etc here is my simple code: Code: Dim CPULoad As AWTRobot Dim cpLoad As Int =NumberFormat ( (CPULoad.SystemCPULoad*100) ,0,2 ) what could cause the issue. Thanks for any help.
R Roycefer Well-Known Member Licensed User Longtime User Feb 23, 2017 #2 Sometimes the call will fail. There's nothing that can be done about it but in my experience it's pretty rare. If you are calling SystemCPULoad numerous times throughout the run time of your program, most of the calls should return correct values. Upvote 0
Sometimes the call will fail. There's nothing that can be done about it but in my experience it's pretty rare. If you are calling SystemCPULoad numerous times throughout the run time of your program, most of the calls should return correct values.
bogdanc Active Member Licensed User Longtime User Feb 23, 2017 #3 Roycefer said: Sometimes the call will fail. There's nothing that can be done about it but in my experience it's pretty rare. If you are calling SystemCPULoad numerous times throughout the run time of your program, most of the calls should return correct values. Click to expand... Hi. Thanks for replay. For some reason on that PC shows alwyas -100. Upvote 0
Roycefer said: Sometimes the call will fail. There's nothing that can be done about it but in my experience it's pretty rare. If you are calling SystemCPULoad numerous times throughout the run time of your program, most of the calls should return correct values. Click to expand... Hi. Thanks for replay. For some reason on that PC shows alwyas -100.
R Roycefer Well-Known Member Licensed User Longtime User Feb 23, 2017 #4 Even if you try calling SystemCPULoad periodically with a Timer? What operation system is on that PC? Upvote 0
Even if you try calling SystemCPULoad periodically with a Timer? What operation system is on that PC?
bogdanc Active Member Licensed User Longtime User Feb 23, 2017 #5 Roycefer said: Even if you try calling SystemCPULoad periodically with a Timer? What operation system is on that PC? Click to expand... I do this on timer every 60sec. Win7 32bit Upvote 0
Roycefer said: Even if you try calling SystemCPULoad periodically with a Timer? What operation system is on that PC? Click to expand... I do this on timer every 60sec. Win7 32bit
R Roycefer Well-Known Member Licensed User Longtime User Feb 24, 2017 #6 And it reports -100 every time? That's very strange. It works perfectly on my Windows 7 machines (32 and 64 bit) and RasPi2. What Java version are you using? Just to be clear, you're declaring the AWTRobot as a Global variable once and then calling SystemCPULoad inside your Timer_Tick event, right? You're not declaring a new AWTRobot each time inside Timer_Tick, right? Upvote 0
And it reports -100 every time? That's very strange. It works perfectly on my Windows 7 machines (32 and 64 bit) and RasPi2. What Java version are you using? Just to be clear, you're declaring the AWTRobot as a Global variable once and then calling SystemCPULoad inside your Timer_Tick event, right? You're not declaring a new AWTRobot each time inside Timer_Tick, right?