Subject: Timers and less (fwd)
From: [email-masked] (Larry Meadows)

16 Aug 1997 10:39:59 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Original-To: [email-masked]
Original-Cc: [email-masked]
X-Mailer: ELM [version 2.4ME+ PL25 (25)]
Original-Sender: [email-masked]

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 [email-masked]  Fri Aug 15 05:22:20 1997
Message-ID: <UnwpQpFz000140iExo@stoneaxe>
Date: Thu, 14 Aug 1997 14:06:29 -0500 (EST)
From: Mark Koi <[email-masked]>
To: [email-masked]
Subject: Timers and less
Sender: [email-masked]
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.  

[email-masked]
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" 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
"[email-masked]" with one line of text: "help".