[webkit-dev] Linux Port: time problem

Ronan Meneu rmeneu at origyn.fr
Tue Aug 29 02:46:41 PDT 2006


Hello,

I think there is a problem in the following function :

double currentTime()
{
    time_t ttime;
    time(&ttime);
    return (double)ttime;
}

from the file WebCore/platform/gdk/SystemTimeLinux.cpp.
With this code, time is rounded to the second. Result is that display is
slow, because timers are delayed too much.

A fix could be to use the gettimeofday function:

double currentTime()
{
  struct timeval aTimeval;
  struct timezone aTimezone;

  gettimeofday( &aTimeval, &aTimezone );
  return (double)aTimeval.tv_sec + (double)(aTimeval.tv_usec / 1000000.0 );
}

I have tested it and now display is immediate on many pages. Layout tests
are executed nearly four time faster.

Does someone confirm this is a bug ? Do i need to fill in a bug and post a
patch ?

Thanks.

  Ronan

-- 
Ronan Meneu
Origyn Web Browser for Embedded Systems Team
Senior Software Engineer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/webkit-dev/attachments/20060829/d3df9e13/attachment.html


More information about the webkit-dev mailing list