I founded a soulution:
#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
Type: Posts; User: Fric
I founded a soulution:
#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
]Isn't it Milliseconds and not Microsseconds usleep is sleeping for?
Anway I'm not sure this aproach will ever work. Its a multitaking OS so when you sleep other processes are using the processor.
...
#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>
/* Valor de 0 a 100 corresponde ao load de 0 a 100 */
#define LOAD 7000
void fullload(int Delay){
long timeStampSeg;
#include <stdio.h>
#include <sys/time.h>
#define LOAD 6
void fullload(int Delay){
int timeStamp;
struct timeval tv;
struct timezone tz;
usleep() works fine but i have another problem:
int x=6; /* It will load the cpu with an average of 60% */
while(1){
usleep(x);
fullload(10-x); /* This doen't exist, i have to create...
want to control the cpu load to test the power consume at a specified load.
Exemple:
-Fix the load at 65% and check the power consume of the computer using a Voltage and Current meter
I was...