.586p
.Model Flat ,StdCall
UNICODE=0
Extrn _wsprintfA : near

include w32.inc

.data

MSG_title db 'CPU Speed by Max',0
cpuspeed db 'CPU Speed = %lu Mhz',0
MSG_Buff db 30 dup (0)

.code

main:
xor eax,eax
db 0fh,31h ;rdtsc
mov ebx,eax
call Sleep,1000
db 0fh,31h ;rdtsc
sub eax,ebx
sub eax,8
xor edx,edx
mov ecx,1000000
div ecx
call _wsprintfA, offset MSG_Buff , offset cpuspeed, eax
call MessageBoxA, 0 ,offset MSG_Buff , offset MSG_title, 0
call ExitProcess , 0

end main
Posted on 2001-12-18 07:16:22 by Max