Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 22267 invoked from network); 15 Dec 2005 17:55:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Dec 2005 17:55:26 -0000 Received: (qmail 18911 invoked by uid 500); 15 Dec 2005 17:55:21 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 18829 invoked by uid 500); 15 Dec 2005 17:55:21 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 18809 invoked by uid 99); 15 Dec 2005 17:55:20 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Dec 2005 09:55:20 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of b.unckel@gmx.net designates 213.165.64.21 as permitted sender) Received: from [213.165.64.21] (HELO mail.gmx.net) (213.165.64.21) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 15 Dec 2005 09:55:19 -0800 Received: (qmail 1176 invoked by uid 0); 15 Dec 2005 17:54:57 -0000 Received: from 83.135.233.244 by www76.gmx.net with HTTP; Thu, 15 Dec 2005 18:54:58 +0100 (MET) Date: Thu, 15 Dec 2005 18:54:58 +0100 (MET) From: "Boris Unckel" To: commons-dev@jakarta.apache.org MIME-Version: 1.0 Subject: Re: [POLL] System.currentTimeMillis() X-Priority: 3 (Normal) X-Authenticated: #143822 Message-ID: <7321.1134669298@www76.gmx.net> X-Mailer: WWW-Mail 1.6 (Global Message Exchange) X-Flags: 0001 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Joerg, this is an absolutely "normal" behaviour. It does not depend on the operating system, but more on system speed. Your CPU has enough power to calculate n-thousand additions in one milli second. It is not predictable, since it depends on the machine in use. I have found this in an other context: Random r1 = new Random(); //depends on System.currentMillis() If you have the need to randomize more than one number (and cannot rely on the same random object) you need one random for the seed, and one random for the number generating: private static final Random RANDOM_FOR_SEED = new Random(); //.... public int generateRandomInt(){ Random localRandom = new Random(RANDOM_FOR_SEED.nextLong()); return localRandom.nextInt(100); } Regards Boris --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org