From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Edwards To: ecos-discuss@sources.redhat.com Subject: [ECOS] MS_TICKS() revisited Date: Fri, 09 Feb 2001 11:14:00 -0000 Message-id: <20010209131835.A4738@visi.com> X-SW-Source: 2001-02/msg00155.html 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