|
-
Apr 4th, 2001, 01:12 AM
#1
Is there anyway to see how may clock ticks have passed after ive executed some code? Or seconds, or anything?
-
Apr 23rd, 2001, 05:01 AM
#2
Junior Member
for the timer, get the dword at 40:6C in real mode, dunno about protected mode
save it, then subtract it from the next value and divide it by 18.2 (approx) to get the number of seconds
(exact is 65536/3600)
in protected mode (like win32) just go
rdtsc ;read timer
mov [__int64],eax
mov 4[__int64],edx
then do the same thing as per the timer, except that you must divide the the result by your clock speed
x dq 0
clockspeed dq 400000000.0
rdtsc
mov [x],eax
mov 4[x],edx
...code...
rdtsc
sub eax,[x]
sbb edx,4[x] ;less 1 if carry
mov [x],eax
mov 4[x],edx ;now x should contain the number of clock ticks
fild qword ptr [x]
fdiv qword ptr [clockspeed]
fistp qword ptr [x] ;now x contains the number of seconds - for more accuracy, store the result in a float or double - fstp qword ptr [double]
this can be done in REAL real mode too, but not v86
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|