This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Macro to convert milliseconds into ticks
- From: Simon Kallweit <simon dot kallweit at intefo dot ch>
- To: Nick Garnett <nickg at ecoscentric dot com>
- Cc: eCos Disuss <ecos-discuss at ecos dot sourceware dot org>
- Date: Thu, 20 Nov 2008 12:58:34 +0100
- Subject: Re: [ECOS] Macro to convert milliseconds into ticks
- References: <49254293.1030309@intefo.ch> <m3bpwa4oij.fsf@xl5.calivar.com>
Nick Garnett wrote:
Simon Kallweit <simon.kallweit@intefo.ch> writes:
Hi
I was looking for a macro to convert fix millisecond intervals into
tick counts to be used for cyg_thread_delay(). I didn't found it, and
was wondering if there is anything against introducing such a macro?
The problem with this is that while you want to convert to/from
millisecond, others might want microseconds, or nanoseconds, or
seconds+microseconds, or seconds+nanoseconds, or fixed or floating
point fractions. Which of these do we supply? If we only supply a
subset, then users still have to convert. Instead we supply the basic
tools and let users do their own conversions. There are several
examples of how to do this in the sources (in tests like tm_basic, and
in the POSIX library) and there is support for creating time
convertors to encapsulate the calculations.
I see your point here, I guess I didn't thought it over well enough.
Also, I could use the POSIX layer. But as I'm currently developing a
GSM/GPRS service layer, I want to minimize any dependencies.
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss