Subject: Re: cost of gettimeofday()
To: Peter Seebach <seebs@plethora.net>
From: Todd Vierling <tv@wasabisystems.com>
List: current-users
Date: 03/08/2002 12:52:32
On Fri, 8 Mar 2002, Peter Seebach wrote:

: So, it looks like some KVM switches simply *SILENTLY* change protocols.  No
: warnings, no nothing; one minute, you're getting 4 bytes per mouse event, the
: next, you're getting 3.

: This pause is, I suspect, detectably longer than the delay between adjacent
: bytes of real mouse input.

Is there any way to, say, read 3 bytes, and from that, determine if the
event should have a 4th byte pending (and use the different protocol)?

(Note:  I don't know the internals of the PS/2 mouse protocol, so ignore
the question if not.)

: So, if I changed psm.c to call gettimeofday() every time it got a byte of
: data, check for long delays... Is this a bad idea?

Well, not gettimeofday() per se, but getting the system tick clock as a
rolling timestamp each time an event fires should be fine, IMHO....

-- 
-- Todd Vierling <tv@wasabisystems.com>  *  Wasabi & NetBSD:  Run with it.
-- CDs, Integration, Embedding, Support -- http://www.wasabisystems.com/