[Bug 1894] missing a tick in _Timespec_To_ticks

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Tue Aug 9 16:29:17 UTC 2011


https://www.rtems.org/bugzilla/show_bug.cgi?id=1894

--- Comment #8 from Jie Liu <lj8175 at gmail.com> 2011-08-09 11:29:17 CDT ---
(In reply to comment #6)
> I'm confused why you add 10000000 in the following line. I also have a hard
> time figuring out what the expected output should be, should it be any number
> greater than 10ms (expressed in ns)?
> 
>     printf("%d: sleep %d ns\n",i,
> (tv.tv_sec-to.tv_sec)*1000000000+tv.tv_usec*1000-to.tv_nsec+10000000);

Yes, the output should be greater than 10ms.
I use "to" to save the time got by the first gettimeofday, and "tv" to save the
time got by the second gettimeofday. And "to" also used in
pthread_cond_timedwait after add 10,000,000ns(10ms).

So, the time diff between two gettimeofday is "tv - (to - 10ms)" , is "tv - to
+10ms ", is "tv - to + 10,000,000ns"

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list