1. counter test
Here's a little 'Windows ( use exw.exe )' program that attempts to access the
high performance counter on your 'puter, ... *if* it has one.
I'd appreciate any results, *especially* if your 'puter doesn't have this
counter,
directly to:
wolfritz at king.igs.net
...thanks, Wolf
-- checkit.exw --
include machine.e
include dll.e
atom stop
object jk
atom arg, t1, t2, speed, diff
arg=allocate(4)
constant
kernel32=open_dll("kernel32.dll"),
ctr=define_c_func( kernel32,"QueryPerformanceCounter",{C_INT},C_INT),
freq=define_c_func( kernel32,"QueryPerformanceFrequency",{C_INT},C_INT)
jk=c_func(freq,{arg})
if jk = 0 then
printf(1,"%s\n",{"NO COUNTER FOUND !"})
else
speed=peek4u(arg)
printf(1,"frequency=%.0f counts/per/sec.\n",{speed})
printf(1,"resolution=%.14f seconds\n",{1/speed})
jk=c_func(ctr,{arg})
t1=peek4u(arg)
jk=c_func(ctr,{arg})
t2=peek4u(arg)
diff=t2-t1
printf(1,"ticks=%d\n",{diff})
printf(1,"function call time=%.14f seconds\n\n",{diff/speed})
end if
-- end code --
2. Re: counter test
frequency=1193180 counts/per/sec.
resolution=0.00000083809652 seconds
ticks=17
function call time=0.00001424764076 seconds
Warning: local variable stop in checkit.exw is not used
Lucius L. Hilley III
lhilley at cdc.net
+----------+--------------+--------------+
| Hollow | ICQ: 9638898 | AIM: LLHIII |
| Horse +--------------+--------------+
| Software | http://www.cdc.net/~lhilley |
+----------+-----------------------------+
----- Original Message -----
From: "wolfgang fritz" <wolfritz at king.igs.net>
To: "Euphoria List" <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Wednesday, June 14, 2000 10:55 AM
Subject: counter test
> Here's a little 'Windows ( use exw.exe )' program that attempts to access
the
> high performance counter on your 'puter, ... *if* it has one.
> I'd appreciate any results, *especially* if your 'puter doesn't have this
> counter,
> directly to:
> wolfritz at king.igs.net
> ...thanks, Wolf
>
<SNIP Code>
3. Re: counter test
------=_NextPart_000_0029_01BFD5F0.4EDC7000
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Freq is 1193180 c\p\s
res is 0.00000083809652
ticks 27 func time 0.00002262860591=20
warning local variable stop not used
Ect ect.............cool
http://ka9qlq.tripod.com/
------=_NextPart_000_0029_01BFD5F0.4EDC7000
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3401" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#a8c8f0>
<DIV><FONT face=3DArial size=3D2>Freq is 1193180 c\p\s</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>res is 0.00000083809652</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>ticks 27 func time 0.00002262860591 =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>warning local variable stop not =
used</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Ect ect.............cool</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2><A=20
------=_NextPart_000_0029_01BFD5F0.4EDC7000--
4. Re: counter test
Thanks for the reports so far, folks.
'ticks', and 'function call time' will always vary with most invocations,
since Windows is, after all, multi-tasking...
I'd be more interested to hear from people who *don't* have a high resolution
timer on their system. Win32.hlp suggests that some hardware doesn't, and if
so, these functions won't work on their system.
Writing a program that ends with, "sorry your hardware can't run this program
!" might be a bit awkward.
..hardware_and_windows_challenged_Wolf
5. Re: counter test
- Posted by Tom Eklöf <darkspace at SUNPOINT.NET>
Jun 15, 2000
-
Last edited Jun 16, 2000
frequency=1193180 counts/per/sec.
resolution=0.00000083809652 seconds
ticks=10
function call time=0.00000838096515 seconds
Interesting little bugger, this. What is it? :)
Sunpoint.net - Kolmannen sukupolven Internet-palvelu
http://www.sunpoint.net