here is a small assembler snippit I used a few years ago. I don't know how to
compile it in VS, but it should be possible to compile this in C++ as a dll and then
call the dll from VB.NET.
JackRazz
..586p
..Model Flat ,StdCall
UNICODE=0
Extrn _wsprintfA : near
include w32.inc
..data
capt db 'CPU Test',0
format db 'CPU Speed = %lu Mhz',0
buffer db 30 dup (0)
..code
main:
xor eax,eax
rdtsc
mov ebx,eax
call Sleep, 1000
rdtsc
sub eax,ebx
sub eax,8
xor edx,edx
mov ecx,1000000
div ecx
call _wsprintfA, offset buffer, offset format, eax
call MessageBoxA, 0 ,offset buffer, offset capt, 0
call ExitProcess , 0
end main
| Is there a way to get the CPU speed (in Mhz) without using WMI? I need to
| include this functionality in a program that have to work also in Windows 98
| and I don't want to distributeWMI apart.
|
|