Re: System.currentTimeMillis() on SMP systems
Randall R Schulz <[email protected]> Fri, 9 May 2008 11:32:33 -0700
| Newsgroups | gmane.comp.windows.devel.java.advanced |
|---|---|
| Message-ID | <[email protected]> |
On Wednesday 07 May 2008 07:37, Rodrick Brown wrote:
> I'm stress testing my backend server and I wrote a small client
> application that uses System.currentTimeMillis() on various
> operations the results dont seem to be consistent with what I would
> expect my system is a 8 core Intel x64 class machine running 64 Bit
> linux. I heard about issues with System.currentTimeMillis() on SMP
> machines is this true? Is there a better approach I should be taking?
Are you trying to measure CPU time consumed? 'Cause if you are, that's=20
not what you're getting from System.currentTimeMillis(). That call=20
returns elapsed / clock time:
=46rom <http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html>:
=2D=3D=3D--=3D=3D--=3D=3D--=3D=3D--=3D=3D--=3D=3D--=3D=3D--=3D=3D--=3D=3D--=
=3D=3D--=3D=3D--=3D=3D--=3D=3D--=3D=3D--=3D=3D--=3D=3D--=3D=3D-
currentTimeMillis
public static long currentTimeMillis()
...
Returns:
the difference, measured in milliseconds, between the current=20
time and midnight, January 1, 1970 UTC.
=2D=3D=3D--=3D=3D--=3D=3D--=3D=3D--=3D=3D--=3D=3D--=3D=3D--=3D=3D--=3D=3D--=
=3D=3D--=3D=3D--=3D=3D--=3D=3D--=3D=3D--=3D=3D--=3D=3D--=3D=3D-
> --
> [ Rodrick R. Brown ]
Randall Schulz
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
This list is hosted by DevelopMentor=AE http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com