Re: gobo/gcc error message

"Paul Cohen" <[email protected]> Wed, 6 Aug 2008 12:48:43 +0200
Newsgroups gmane.comp.lang.eiffel.gobo.devel
Message-ID <[email protected]>
Hi,

On Wed, Aug 6, 2008 at 12:03 PM, Eric Bezault <[email protected]> wrote:
> Müller Gloria wrote:
>> Something unrelated. I wanted to time my code. Is it really that Eiffel can only measure
>> time up to a precision of seconds? If I want to time my code I need at least nanoseconds.
>> Any idea how to do this? Using command line "time" is inconvenient. I want to measure
>> time of little code pieces not of the entire app.
>
> You would have to find an Eiffel date/time library which supports
> nanoseconds, or write one if one does not exist yet. The Gobo
> date/time library is indeed limited to milliseconds. You may have
> a look at ISE's EiffelTime library, but I think that it has the same
> limitation when calling `make_now'.

High precision timing is very dependent on the hardware and operating
system you are using. Millisecond resolution should be good enough for
most non-embedded situations.

On Linux you could try wrapping the High Precision Event Timer (HPET)
and you could maybe achieve nanoseconds resolution. I'm not sure. See:

    http://en.wikipedia.org/wiki/High_Precision_Event_Timer

See here for an example C program using HPET:

    http://www.mjmwired.net/kernel/Documentation/hpet.txt

If you do wrap HPET I would be glad to use it! ;-)

/Paul

-- 
Paul Cohen
mobile: +46 730 787 035
e-mail: [email protected]

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/