| |
|
|
Jac de Lad | Hello Frank.
since some Meet try I subesquent Delphiquelltext for XPIA umzuschreiben:
function GetCPUSPeed():Longword;stdcall;
var timerhigh,timerlow:dword;
begin
SetPriorityClass(GetCurrentProcess,REALTIME_PRIORITY_CLASS);
SetThreadPriority(GetCurrentThread,THREAD_PRIORITY_TIME_CRITICAL);
try
asm
dw 310Fh
mov TimerLow,eax
mov TimerHigh,edx
end;
Sleep(1000);
asm
dw 310Fh
sub eax,TimerLow
sub edx,TimerHigh
mov TimerLow,eax
mov TimerHigh,edx
end;
Result:=Round(TimerLow/1000000);
finally
SetPriorityClass(GetCurrentProcess,NORMAL_PRIORITY_CLASS);
end;
end;
unfortunately is by me but nothing rausgekommen. If you or someone other pleasure moreover has can it/tappt im dunkeln/it whom Yes time paraphrase...
Jac
PS: The View source gives The actually (not The nominale) frequency the CPU in MHz back. |
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 05/14/07 ▲ |
|
|
|
|
Frank Abbing | my code to Systemzeitermittlung sees similar from, only even for all processes at the same time. shining but not everywhere To functions. your Sourcecode can I not translate. knows z.B. not, what TRY is, or FINALY. |
|
|
| |
|
|
|
Jac de Lad | Try points on, that the following code probiert go should and in the Fehlerfall on the end the Try-Blocks sprang becomes (is How begin...end). Finally points on, that in Fehlerfall (see Try) the aufgeführt go should (usually Speicherfreigaben and so). |
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 05/14/07 ▲ |
|
|
|
|
Jac de Lad | I habs too not yet geschafft, the übersetzbar To style. some functions must sure invoked go...is How said Delphi. but the code is sure, means has me always right Results supplied.
Jac |
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 05/14/07 ▲ |
|
|
|
|
Frank Abbing | dw 310Fh
One Integerwert? For which is the, or is the only one Abstandhalter?
mov TimerLow,eax mov TimerHigh,edx
Hm, where come because The values into Registern EAX and EDX? at least EDX is me unclear. |
|
|
| |
|
|
|
Jac de Lad | You überfragst my know. The Source watts not of me develops. I had it only one befreundeten Programmer receive, as i very the used have. does me sorrow, I thought, You can there what zaubern... |
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 05/14/07 ▲ |
|
|
|
|
Michael Wodrich | $310f is a hartcodierter: RDTSC through CoDec ermittelt; whom code Gibts ex Pentium CPUs - but me known Assembler translate whom not.
Best wishes Michael Wodrich
P.s.: Date is to that RDTSC very auskunftsfreudig... |
|
|
| Programmieren, das spannendste Detektivspiel der Welt. | 05/14/07 ▲ |
|
|
|
|
Jac de Lad | In Delphi GEHTS. i'd Yes gladly ne DLL Upload, but I can now no produce, I Delphi not installs have. I Have already any volume verpackt, because I umziehe (zieht itself yet To end the month's). but The function stick too in Parcival. |
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 05/14/07 ▲ |
|
|
|
|
Frank Abbing | @Micheal: MASM32 knows whom commands very well. only must You adjust on Pentiumcode.
@Jac: insane, the code functions Yes really! CompileMarkSeparation {$cleq}
Declare x&
Cls
Print Ermittle Frequenz der CPU...
AsmStart CPUSpeed
.686p
invoke GetCurrentProcess
invoke SetPriorityClass,eax,REALTIME_PRIORITY_CLASS
invoke GetCurrentThread
invoke SetThreadPriority,eax,THREAD_PRIORITY_TIME_CRITICAL;
rdtsc
push eax
invoke Sleep,1000
rdtsc
pop ebx
sub eax,ebx
xor edx,edx
mov esi,1000000
div esi
push eax
invoke GetCurrentProcess
invoke SetPriorityClass,eax,NORMAL_PRIORITY_CLASS
pop eax
AsmEnd(x&)
Print ...+Str$(x&)+ MHz.
WaitInput
End
|
|
|
| |
|
|
|
Jac de Lad | Kannste Yes with as example take in! |
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 05/15/07 ▲ |
|
|
|
|
Frank Abbing | Yes, must it with opportunity but again adjust for 64 bit worth. your code using too only whom Lowwert, means only 32 bit (Result:=Round(TimerLow/1000000)). therefore could the ermittelte worth on some machines defective his. and my code entsprich your. |
|
|
| |
|
|
|
Jac de Lad | Hm, on all Rechnern, where I the yet tested have (too the Benchmark of Parcival) running the code correct. Perhaps kannste the Yes yet Change, that of a double returns, for genauere Results. Freut me, I what brauchbares post could. |
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 05/16/07 ▲ |
|
|
|