public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] MS_TICKS() revisited
@ 2001-02-09 11:14 Grant Edwards
  2001-02-09 11:50 ` Jonathan Larmour
  0 siblings, 1 reply; 11+ messages in thread
From: Grant Edwards @ 2001-02-09 11:14 UTC (permalink / raw)
  To: ecos-discuss

I've modified my ms_ticks stuff so that there are two routines.
Both return the current system time, but one delays for a
millisecond and the other doesn't.

do_ms_tick()      // delays for 1ms, returns system time
get_ms_ticks()    // returns system time

#define MS_TICKS()  get_ms_ticks()
#define MS_TICKS_DELAY() -> do_ms_tick()

This saves a few milliseconds of overhead here and there
(nothing worth worrying about), but mostly it makes it clear
whether the caller wants to delay for a millisecond or just to
read the system time.

Attached is a patch against CVS sources for anybody who wants it.

I've only done limited testing, so it's possible I'm missing a
delay where I need one.  IOW, there may be an MS_TICKS() that
should be MS_TICKS_DELAY() -- but I don't think so.

NB: this patch also includes a fix to net_io_getc_nonblock() so
    that it always sets its return value properly.  AFAICT, the
    old version worked OK because whatever happened to be left
    in R0 when the function fell off the bottom always had a
    non-zero.

-- 
Grant Edwards
grante@visi.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2001-02-12  9:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-09 11:14 [ECOS] MS_TICKS() revisited Grant Edwards
2001-02-09 11:50 ` Jonathan Larmour
2001-02-09 11:57   ` Grant Edwards
2001-02-09 12:03     ` Jonathan Larmour
2001-02-09 12:12       ` Grant Edwards
2001-02-09 14:03         ` Jonathan Larmour
2001-02-09 14:04           ` Grant Edwards
2001-02-11 12:18   ` Gary Thomas
2001-02-12  7:30     ` [ECOS] " Grant Edwards
2001-02-12  7:33       ` Gary Thomas
2001-02-12  9:55         ` Jonathan Larmour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).