- function get_cpu_speed:dword;
- {
- voila un chtite functon pour prendre la vitesse
- du cpu qui marche avec un pentium au minimum
-
- bon coding a vous ...
-
- ManChesTer (c)2002 freeware
- }
- var Speed : dword;
- begin
- SetpriorityClass(getcurrentprocess,REALTIME_PRIORITY_CLASS);
- SetThreadPriority(getcurrentThread,THREAD_PRIORITY_TIME_CRITICAL);
- asm
- push eax
- push edx
- push ecx
- push 1000
- call sleep // appel de sleep(1000)
- dw $310F // rdtsc (red internal cpu timer in cycle)
- add eax,edx
- mov speed,eax // stokez les cycles machine
- push edx
- xor eax,eax
- push 1000
- call sleep // appel de sleep(1000)
- pop edx
- dw $310F // relire le timer cpu rdsc
- add eax,edx
- sub eax,speed // garder 1000 millisecondes (1 seconde)
- mov speed,eax // le stocké dans speed;
- pop ecx
- pop edx
- pop eax
- end;
- result:=round((speed / 1000000) / 3)*3; // div 3 * 3 a cose de busfeq
- end;
function get_cpu_speed:dword;
{
voila un chtite functon pour prendre la vitesse
du cpu qui marche avec un pentium au minimum
bon coding a vous ...
ManChesTer (c)2002 freeware
}
var Speed : dword;
begin
SetpriorityClass(getcurrentprocess,REALTIME_PRIORITY_CLASS);
SetThreadPriority(getcurrentThread,THREAD_PRIORITY_TIME_CRITICAL);
asm
push eax
push edx
push ecx
push 1000
call sleep // appel de sleep(1000)
dw $310F // rdtsc (red internal cpu timer in cycle)
add eax,edx
mov speed,eax // stokez les cycles machine
push edx
xor eax,eax
push 1000
call sleep // appel de sleep(1000)
pop edx
dw $310F // relire le timer cpu rdsc
add eax,edx
sub eax,speed // garder 1000 millisecondes (1 seconde)
mov speed,eax // le stocké dans speed;
pop ecx
pop edx
pop eax
end;
result:=round((speed / 1000000) / 3)*3; // div 3 * 3 a cose de busfeq
end;