Hi,
ich habe ein kleines Countdown Skript gebastelt, was 100% Systemleistung frisst. (Bei Dualcore nur 50%).
Kann mir einer Tipps geben, wie ich dies verhindern kann?
Hier einmal das Skript:
ich habe ein kleines Countdown Skript gebastelt, was 100% Systemleistung frisst. (Bei Dualcore nur 50%).
Kann mir einer Tipps geben, wie ich dies verhindern kann?
Hier einmal das Skript:
Code:
#include <stdio.h>
#include <time.h>
#include <conio.h>
#include <windows.h>
void wait ( int seconds )
{
clock_t endwait;
endwait = clock () + seconds * CLOCKS_PER_SEC ;
while (clock() < endwait) {}
}
int main (int argc, char * argv)
{
int test=argv[0];
int test2=argv[1];
int m=10;
for(int x=0;x<m;x++)
{
printf ("Starting countdown...\n");
for (int n=8000; n>0; n--)
{
printf ("%d\n",n);
wait (1);
}
int y=10;
for(int i=0;i<y;i++)
{
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
printf ("ausgeführt\n");
Sleep(5000); //5 Sekunde
}
}
getch();
return 0;
}