I suspect that calls from separate threads (>15) are having a negative effect on performance. Is there a better way to get at the system time in concurrent applications?
views:
124answers:
2
+5
A:
If it really is a problem, you can have a background thread store the current time in a volatile
. Or just call it less often.
Tom Hawtin - tackline
2010-03-28 03:16:20
+1 - there is definitely something a bit weird about an application which has to make frequent calls to `System.currentTimeMillis`.
Stephen C
2010-03-28 03:24:00
+1
A:
Just a little tip:
I read from google engineers and other programmers that it is better to use System.nanotime. For example joshua bloch
For interval timing, always use System.nanoTime in preference to System.currentTimeMillis
Alfred
2010-03-28 04:56:06
Doesn't answer the question. Also, even according to your quote, System.nanoTime is preferred for interval timing, there is no mention of what the OP is using system time for. Interval timing may not be applicable here.
Tim Bender
2010-03-28 07:07:16
Maybe it does not answer the question directly, but I think already others answered the question so I was only providing a tip I read.
Alfred
2010-03-28 13:28:37
http://www.techper.net/2008/08/10/systemcurrenttimemillis-systemnanotime-and-their-resolution/timeinMillis has problems with MS windows' granularity
Gene T
2010-04-18 17:45:24
Thanks for the link Gene T :). Know we know a little better why currentMillis could be a problem.
Alfred
2010-04-20 00:47:01