Yes,
nanoseconds seems to me much more reliable :
startTime = System.nanoTime();
for (int i = 0; i < arr1.length; i++) {
arr2[i] = arr1[i];
}
endTime = System.nanoTime();
System.out.println("Time for manual copy: " +
(endTime-startTime) / 1000000.0D + " ms.");
Thanks a lot!
Cheers
Mirko
2010/8/16 Michèle Garoche <[email protected]>
>
>
> On Aug 16, 10:56 am, TheIrda <[email protected]> wrote:
> > Hi,
> >
> > I have a question on this LAB exercise. Running the code I have a
> > result of 0ms for both the manual copy and the System.arraycopy to
> > complete. I thin it is due to some optimizations in the new JVMs.
> >
> > I've also checked the start and end date and these are get correctly,
> > but with 0ms of difference.
> >
> > Has anyone else seen the same behaviour?
> > I'm using Windows XP with the following Java env:
> >
> > java version "1.6.0_18"
> > Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
> I cannot reply accurately, but you may try System.nanoTime() if it
> exists for you.
>
> And see if you get a difference.
>
> Michèle Garoche
>
> --
> To post to this group, send email to
> [email protected]
> To unsubscribe from this group, send email to
> [email protected]<javaprogrammingwithpassion%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/javaprogrammingwithpassion?hl=en
>
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en