[kaffe] System.currentTimeMillis() buggy?

pancake pancake at phreaker.net
Mon Jan 3 10:25:43 PST 2005


yes linux 2.6

On Sun, 2 Jan 2005 20:55:02 -0600 (CST)
Adam Heath <doogie at brainfood.com> wrote:

> On Sat, 1 Jan 2005, pancake at phreaker.net wrote:
> 
> > Try this snipped:
> >
> >   public static void main (String [] args)
> >     {
> >         // JIT/hotspot warmup:
> >         for (int r = 0; r < 3000; ++ r) System.currentTimeMillis ();
> >
> >         long time = System.currentTimeMillis (), time_prev = time;
> >
> >         for (int i = 0; i < 5; ++ i)
> >         {
> >             // Busy wait until system time changes:
> >             while (time == time_prev)
> >                 time = System.currentTimeMillis ();
> >
> >             System.out.println ("delta = " + (time - time_prev) + " ms");
> >             time_prev = time;
> >         }
> >     }
> >
> > ---
> >
> > On my box results are:
> >
> > delta = 1 ms
> > delta = 4 ms
> > delta = 1 ms
> > delta = 1 ms
> > delta = 1 ms
> 
> 
> Not at all.  What OS?  Is it linux?  Is it 2.6?
> 
> 2.6 has HZ = 1000.
> 
> _______________________________________________
> kaffe mailing list
> kaffe at kaffe.org
> http://kaffe.org/cgi-bin/mailman/listinfo/kaffe




More information about the kaffe mailing list