On Fri, 20 Feb 2009 15:16:18 +0100 (CET) Vincent Torri <vto...@univ-evry.fr> said:
> > > On Fri, 20 Feb 2009, Gustavo Sverzut Barbieri wrote: > > > On Fri, Feb 20, 2009 at 11:04 AM, Vincent Torri <vto...@univ-evry.fr> wrote: > >> > >> > >> On Fri, 20 Feb 2009, Gustavo Sverzut Barbieri wrote: > >> > >>>> My question is: is ecore_time_get() used for something else that > >>>> measuring > >>>> the time between 2 moments ? If no, I think that I can use those high > >>>> resolution timers on Windows. > >>> > >>> Sometimes I use it to get real time, to print or insert in db, easy to > >>> change if required, but I wonder: is your time in seconds, or what? > >>> Isn't it easy to apply an offset and scale to get the number of > >>> seconds, at least approximately? > >> > >> then it will be exatly the same computations than the current code, with > >> just a higher precision. The problem is more the computations, which are a > >> bit heavy to get the same value than gettimeofday(). > > > > Well, is it that heavy? I mean, the real code is used just few times > > per loop, if one uses ecore_loop_time_get() it's just one, so should > > not impact at all. But I'd say we can use a compile-time switch and > > let some embedded users choose the fast or the precise way. > > well, in evil, i compute the # of seconds since 1st january 1970, then i > tranformat that to get something similar to gettimeofday, then > ecore_time_get() re-tranform again what i got to obtain the number of > seconds. That's why i say "heavy". > > I wanted to avoid to add windows code, but maybe i should actually add it > in ecore, t avoid extra computations what you CAN do... is something like this: 1. first time ecore_time_get() is called, have a static been_called = 0; if this is 0, then run the code that gets the current time the slow way AND it also gets the high resolution timers. now it has BOTH. 2. store the high-res "first call" time and the "time of first call" time. 3. every other call after that get the high-res timer only, subtract "high res first call time", then add "time of first call" time. 4. return this. so you only do the slow path once to get the "starting point". after that just adjust for that point. :) > Vincent > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > enlightenment-devel mailing list > enlightenment-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) ras...@rasterman.com ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel