On Thu, Apr 17, 2003 at 12:25:03PM -0400, Peter Chen wrote: > On Thu, 2003-04-17 at 11:51, Chris Fedde wrote: > > This is getting bizare. Administrative changes to the system clock > > are rare indeed. And if epoch seconds is being changed on a frequent > > basis there is more going wrong than POE can be expected to correct. > > > > Is it posible that I am missing something obvious? > > Have you taken a look at the links that Garrett provided? One of them > illustrates this point very well. > > http://lwn.net/Articles/23161/ > > The concept as I understand from the discussion is that a kernel does > not depend on system time to dispatch its events. It uses "jiffies" > clock. Here is the relevant extract: > > monotic time > (Posted Feb 27, 2003 6:56 UTC (Thu) by hpreg) (Post reply) > > "Within the kernel, nobody every uses the real time clock to > measure passage of time. They use the 'jiffies' clock, which > cannot be turned back at any level higher than 'modifying the > operating system.' We need that at user level." > > You already have it. And it is Posix. > > man 2 times > > Because 'jiffies' clock is monotonically increasing, one is not > vulnerable to clock being reset.
Unfortunately this is not necessarily true. My tests on FreeBSD show that times() does not return a monotonically increasing value. Setting the time back two minutes: now(1060100580.89445) - then(1060100701.61873) = diff(-120.724280953407) ( clk_now(-1746079118) - clk_then(-1746063665) ) / CLOCKS_PER_SEC = -120.7265625 "now" and "then" being time() values, while "clk_now" and "clk_then" are POSIX::times() values. Are there any other sources of monotonic time available to Perl? -- Rocco Caputo - [EMAIL PROTECTED] - http://poe.perl.org/
