[Webkit-unassigned] [Bug 28126] [Haiku] Adding SharedTimer to WebCore.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 14 22:32:29 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=28126





--- Comment #9 from Maxime Simon <simon.maxime at gmail.com>  2009-08-14 22:32:28 PDT ---
(In reply to comment #8)
> (From update of attachment 34719 [details])
> Isn't this reversed?
> 
>      bigtime_t interval = fireTime - currentTime();
>  90     bigtime_t milliSecondInterval = interval < 0 ? 0 : interval * 1000;
> 
> is currentTime() in nanoseconds?  If so "interval" should be labled as such?

Reversed?

- bigtime_t is a microsecond unit (see extract from the BeBook underneath).
- currentTime() returns a result in seconds (with a precision of a microsecond,
see extract from wtf/CurrentTime.cpp below).
- I hope fireTime is in second too.
- Then, the value passed as argument of the BMessageRunner should be a
bigtime_t, that's to say a microsecond value.
- It means that interval should be multiplied by 1,000,000 not 1,000. The
milliSecondInterval variable must be renamed to microSecondInterval. And,
interval should be a double, not a bigtime_t.

Extract from the BeBook:
typedef int64 bigtime_t
This type records the time in microseconds as a 64-bit integer.

Extract from <wtf/CurrentTime.cpp> :
gettimeofday(&now, &zone);
return static_cast<double>(now.tv_sec) + (double)(now.tv_usec / 1000000.0);

So, if my reasoning is right, this code is wrong but not reversed. :)

Regards,
Maxime

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list