Mail Archives: cygwin/1997/08/16/10:39:59
The following code works well if you are using a pentium, ppro, or pII; it
is an interface to the on-chip cycle counter:
.file "timer86a.s"
.text
.align 16
.globl _iclock
_iclock:
.byte 0x0f, 0x31
ret
In C, declare iclock as a long long int, it returns a 64-bit
integer that has resolution equal to the clock rate of the
chip. The return value is in %eax, %edx (low, high) which
matches the C calling convention.
If you want time as a double you just divide the return
value by the clock frequency:
extern long long iclock()
time = iclock() / 200.0e6;
I guess you can use inline assembler in gcc, I haven't tried.
----- Forwarded message from Mark Koi -----
From gnu-win32-owner AT cygnus DOT com Fri Aug 15 05:22:20 1997
Message-ID: <UnwpQpFz000140iExo AT stoneaxe>
Date: Thu, 14 Aug 1997 14:06:29 -0500 (EST)
From: Mark Koi <koi AT ssa DOT crane DOT navy DOT mil>
To: gnu-win32 AT cygnus DOT com
Subject: Timers and less
Sender: owner-gnu-win32 AT cygnus DOT com
Precedence: bulk
I just installed the binaries. I was using
DJGPP before with ALLEGRO for timers. Those
allegro library calls don't work, and can't
seem to compile allegro with gnu-win32.
DOES SOMEBODY HAVE A SIMPLE TIMER PROGRAM?
NEED RESOLUTION OF 100ms, not a big request
but a little lost.
Also, can somebody mail me a uuencoded copy
of less.exe for gnu-win32. Or is it just
as easy to get source and compile.
koi AT ssa DOT crane DOT navy DOT mil
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
----- End of forwarded message from Mark Koi -----
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -